Skip to main content
Known Participant
January 14, 2009
Question

two onEnterFrame's on same mc

  • January 14, 2009
  • 5 replies
  • 323 views
I already have one onEnterFrame that calculates _xscale on a movieclip, but I also want to make another onEnterFrame that affects the _alpha

How do I do this?
This topic has been closed for replies.

5 replies

hoppe11Author
Known Participant
January 15, 2009
thanks for input :)
clbeech
Inspiring
January 15, 2009
well it does depend on what it is that you are trying to acheive, but the Tween class can create transitions with a simple call. for instance if you are scaling the mc up you could use something like:

//AS2 packages import
import mx.transitions.Tween;
import mx.transitions.easing.*;

new Tween(mc, '_xscale', Strong.easeOut, 0, 100, 30, false);

this will scale the clip named 'mc' from 0 to 100 percent over 30 frames. so the same can also be done with the alpha property.

new Tween(mc, '_alpha', Strong.easeOut, 0, 100, 30, false);

one can tween most properties of any object including the 'position' (ie. x and y values) you can place these calls within the event handlers of you buttons, or on the timeline, or within a method that you call to activate the Tween. look up the Tween class in the Flash Help docs for more information.
hoppe11Author
Known Participant
January 15, 2009
the _xscale can be started and stopped at any time like a onRollOver activates the _alpha
hoppe11Author
Known Participant
January 15, 2009
I can't put both in the same onEnterFrame because they are activated at seperate time

what it the tween class about?
clbeech
Inspiring
January 15, 2009
place the alpha transition within the same onEnterFrame.

an alternative solution here would be to use the Tween class to do both simultaneously.