all groups > flash actionscript > august 2004 >
You're in the

flash actionscript

group:

on(rollOut) won't work...


on(rollOut) won't work... scottPadgett
8/14/2004 11:02:47 PM
flash actionscript:
can anyone take a look at this menu thing i'm building... i'm using the
rollOver event and it works but then for some reason the rollOut event doesn't.
can anyone spot what i'm doing wrong?

much thanks! i get this to work easily in Livemotion but in Flash I can't get
all the mouse events working for a movie clip.


Re: on(rollOut) won't work... kglad
8/14/2004 11:16:09 PM
Re: on(rollOut) won't work... scottPadgett
8/15/2004 3:28:00 AM
ok, that makes sense. may i ask you, though, what you'd suggest to do if you
want the rollover behaviors to occur regardless of position on the timeline?
in Adobe's LM2, which is where i'm coming from, if you set some code to occur
when a movieClip is rolled over, it will trigger all the time. the on() events
are independent from timelines in the composition (and are not really revealed
as straight-forwardly as in the Flash Actionscript editor). i was assuming
that in Flash, if you assigned an on(event) script to a button without
selecting a specific keyframe that this code would be triggered any time the
event occured on the button throughout the whole comp. is there an easy way to
get this result?

maybe this is just a difference between authoring in Livemotion and Flash that
I'll have to get used to?

thanks!!


Re: on(rollOut) won't work... kglad
8/15/2004 11:22:49 PM
that can't be right about lm2. that would mean one button couldn't have
different button handlers when the movie was in different frames.

anyway, to answer your question just make a layer for your button, attach the
code and create a frame at the end of your main timeline. that code will
remain, in effect, over the entire timeline.
Re: on(rollOut) won't work... scottPadgett
8/16/2004 2:05:43 PM
LM2 handles event handlers in a different manner from Flash. You don't ever
write on() event handlers in LM2. The app handles the coding for event
handlers itself. There is actually a separate scripting window for event
handlers as opposed to scripts that occur at a frame on the timeline, and you
have separate depositories for code for the different events in this
environment. You simply drop the code that you want to happen on rollover into
the onRollover window, etc...

So to do what you point out in LM2, you have to duplicate the movieClip that
you're using and paste it on the timeline over the frames where you want it to
have different behaviors. Then you assign new event handlers to the new
movieClip instance. The difference in interface between LM2 and Flash is why
I'm having difficulties with this. Seems that the Flash way may be the better
way, though...

I dig your tip, though. I just realized yesterday that eventHandlers for an
instance do apply to a whole keyframe/framespan and that you simply have to
re-initialize them at new key frames.

Thanks for your response!


Re: on(rollOut) won't work... kglad
8/16/2004 2:20:26 PM
Re: on(rollOut) won't work... scottPadgett
8/16/2004 5:09:26 PM
AddThis Social Bookmark Button