I have a lot of objects in my app that would benefit from behaviour scripts instead of having the code local to them. There's one detail that has stopped me from doing that so far. Occasionally, an object will need to need to execute some extra code unique to itself after the behaviour script has executed. What's the best way to handle that situation?
Thanks,
Pete
Behaviours qustion
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Behaviours qustion
Use the dispatch command in the behavior script:
button 1 (the behavior button):
button 2:
if there's a morestuff handler in the child control it will be called, otherwise it will just be passed on.
button 1 (the behavior button):
Code: Select all
on mouseUp
put "hello" after msg
dispatch "morestuff"
end mouseUp
Code: Select all
on morestuff
put "more stuff" after msg
end morestuff