Jump to content
Search Community

bring to front

chefkeifer test
Moderator Tag

Recommended Posts

is there a way within a tween to bring the mc to the front. like setChildIndex.

 

i have two movie clips that are on the stage and both of those movie clips have animation in them as well as a button. but when the one is playing i need it to be on top so that the button cans be accessible.

Link to comment
Share on other sites

Sure,

 

TweenLite.to(mc, 1, {x:100, delay:0.5, onStart:bringToFront, onStartParams:[mc]});

function bringToFront(object:DisplayObject):void {
   object.parent.addChild(object);
}

 

onStart allows you to define a function to call when the tween starts. In this case, after the delay of 0.5 seconds, the tween will begin and call the onStart which is pointed to bringToFront. Make sense?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...