Behaviors

George C Brackett gbrackett at luceatlux.com
Mon Oct 26 10:39:55 EDT 2009


So the mouseUp message goes to the control script first (I get  
confused about this) and, if it's not handled, on to the behavior  
script, right? So by handling the mouseUp message in the control  
script, and NOT passing it on, the mouseUp message never reaches the  
behavior script. Do I have that right, Trevor?

George

On Oct 26, 2009, at 9:47 AM, Trevor DeVore wrote:

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
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list