Behaviors
Beat Cornaz
B.Cornaz at gmx.net
Sun Oct 25 11:39:03 EDT 2009
I started to use Behaviors today and ran into two things :
1. I have a behavior assigned to a couple of buttons and some label
fields.
The script of the behavior button is :
on mouseEnter
set the uVraagteken of stack "Timer-general_Lib" to true
end mouseEnter
on mouseLeave
set the uVraagteken of stack "Timer-general_Lib" to false
end mouseLeave
Now all of a sudden this 'behavior' is all over the place. This
'behavior' is also excecuted when I mouseEnter a graphic or a button
which has the behavior removed. Even with a freshly created button.
And it is the script in the behavior button, because if I comment it
out, nothing happens. What is the matter here? For a while it worked ok.
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'.
This works, but is the wrong order :
on mouseUp
Do B
pass mouseUp -- to activate the behavior
end mouseUp
I can't do it with 'send in Time' because the behavior (DoA) will
exit to top in certain conditions.
I have come up with the inelegant solution : (especially if mouseDown
has already a script). Any better ideas?
on mouseDown
mouseUp -- activates the behavior
DoB
end mouseDown
on DoB
-- do what is needed
end DoB
Any better ideas?
best,
Beat
More information about the use-livecode
mailing list