Share Posted September 14, 2015 Hello everyone I wonder something about TweenMax, onComplete function. Normally when i use onComplete function its working just perfect but when i try to send a value like a movieclip, onComplete function starting with TweenMax. Here is my code : import flash.events.MouseEvent; import com.greensock.*; import com.greensock.easing.*; for(var i:int= 0;i<5;i++) { this["k"+i.toString()].buttonMode = true; this["k"+i.toString()].addEventListener(MouseEvent.CLICK, sendMyMC); } function sendMyMC(e:MouseEvent) { TweenMax.to(e.currentTarget,1,{x:400,ease:Back.easeOut,onComplete:KillMC(e.currentTarget.name)}); } function KillMC(name:String) { removeChild(this[mc]); } In this code I want tween first then removeChild but it just remove my mc on stage and i cant see that Tween :/ Link to comment Share on other sites More sharing options...
Share Posted September 14, 2015 you need to use onCompleteParams separately function sendMyMC(e:MouseEvent) { TweenMax.to(e.currentTarget,1,{x:400,ease:Back.easeOut,onComplete:KillMC, onCompleteParams:[e.currentTarget.name]}); } function KillMC(name:String) { trace(name); //removeChild(this[mc]); } Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now