Possible to attach multiple behaviors to button?
Posted: Wed Nov 19, 2014 7:32 pm
Hi, After reading the manual entry on behaviors, and searching this forum, I think I probably already know the answer, but just to double-check... It is possible to attach multiple behaviors to an object-- like a button?
If it is not possible through the property window, can multiple behaviors be instanced, and their properties populated, using code?
if you can't use multiple behaviors, then how would you handle the following?
Imagine you have four buttons. Each button needs to go to a different card. Each button needs to call a handler. But two of the buttons need to call a second handler.
In other languages I'd create two behaviors. One for the "goTo" (custom property: pDestination), and a second for the "doHandler" (custom property: pHandler), and attach them to the buttons as needed. All four buttons would have both goTo and doHandler behaviors, with two of the buttons having a second instance of doHandler.
If multiple behaviors are not possible in LC, how should I approach this? I'm kind of looking for best practices for a large project. Like if you were to multiply the example by dozens or even hundreds of cards, buttons and handlers?
Thanks in advance for any help.
If it is not possible through the property window, can multiple behaviors be instanced, and their properties populated, using code?
if you can't use multiple behaviors, then how would you handle the following?
Imagine you have four buttons. Each button needs to go to a different card. Each button needs to call a handler. But two of the buttons need to call a second handler.
In other languages I'd create two behaviors. One for the "goTo" (custom property: pDestination), and a second for the "doHandler" (custom property: pHandler), and attach them to the buttons as needed. All four buttons would have both goTo and doHandler behaviors, with two of the buttons having a second instance of doHandler.
If multiple behaviors are not possible in LC, how should I approach this? I'm kind of looking for best practices for a large project. Like if you were to multiply the example by dozens or even hundreds of cards, buttons and handlers?
Thanks in advance for any help.