Behaviors

Trevor DeVore lists at mangomultimedia.com
Mon Oct 26 09:47:31 EDT 2009


On Oct 25, 2009, at 11:39 AM, Beat Cornaz wrote:

> 2.  A couple of btns have a behavior (DoA) assigned for mouseUp. Now  
> one of the buttons has an additional task to perform on mouseUp  
> (DoB). 'DoA' needs to be done before 'DoB'.

Beat,

When working with behaviors and engine events I usually define a  
second command in the behavior script that the behavior calls from the  
engine event. For example, a mouseUp would look like the following:

===============
Behavior Script
===============

on mouseUp pBtnNum
     _mouseUp pBtnNum
end mouseUp


command _mouseUp pBtnNum
     DoA
end _mouseUp


Now if you want to add additional functionality in mouseUp then you  
can make a call to the behavior _mouseUp handler. This will provide  
all of the functionality that the behavior provides at which point you  
can provide any additional functionality. In your case you would call  
DoB:

===============
Control Script
===============

on mouseUp pBtnNum
     _mouseUp pBtnNum
     DoB
end mouseUp


-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: http://revolution.bluemangolearning.com



More information about the use-livecode mailing list