FWIW whenever I have a button which should animate when cliked, I add the behavior to
the scriptInstanceList during runtime. This prevents that the button runs an exitframe
with a flag saying if pFlag then me.Animate(). The animation behavior deletes itself
from the scriptinstancelist when done. This has an effect on performance especially
when there's lot's of buttons or whatever.
I like changing ancestor too, 'cause I like the idea that, instead of asking if a
condition is true or not then just do it the same way all the time since the condition
has been changed by changing the ancestor.
Why am I always reading this list late at night??? ....sleep...
John
>
> Irv Kalb <[EMAIL PROTECTED]> wrote:
> > I typically use a technique to specifically avoid the need
> > for ancestors and buttons. I describe this technique in
> detail in my
> > article on DOUG at:
> >
> > http://www.director-online.com/accessArticle2.cfm?id=340
> >
> > But here is the basic idea. Create a button behavior that handles
> > the on screen actons of the button (up, down, rollover), etc. In
> > that script, when you detect that the button has been hit, then you
> > send out a special named message to another behavior attached to the
> > same sprite.
>
> Hi Roy,
>
> For Toggle Buttons, I use a similar system to Irv's. Toggle buttons
> need to send added-value information to the second behavior:
> the mouseUp
> event needs to know if the button is now On or Off.
>
> Push Buttons and Radio Buttons will always be On when clicked, so the
> situation is simpler. For these, I use behaviors which do
> not send any
> special message. These behaviors should be the first in the
> scriptInstanceList: they block any mouse events which should not reach
> the second behavior. The second behavior handles the action of the
> button and can be something very simple like...
>
> on mouseUp
> go "credits"
> end
>
> ... or it can be more complex.
>
> You can find a 96 K movie with an example of my "Mouse
> States" behavior
> for Push Buttons at:
>
> >> http://perso.planetb.fr/newton/History.dir
>
> The behavior is on the Go First, Back, Forward and Go Last buttons.
>
> I don't think I have an example of my "Radio Button Group" behavior on
> line.
>
> Cheers,
>
> James
>
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
> email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo. Thanks!]
>
>
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]