Share Posted August 2, 2013 Sometimes I need to execute code at a certain point in the timeline. The call() function works fine to call external functions. However, when the function isn't called more than once, an external function seems unnaccessary. Is there any way to execute an inline function? This doesn't work: myTimeline.call(function() { doThis(); doThat(); var myVar = new MovieClip(); etc. }); Link to comment Share on other sites More sharing options...
Share Posted August 3, 2013 Yes, the way you suggested seems to work just fine. import com.greensock.*; var tl:TimelineLite = new TimelineLite(); tl.to(mc, 1, {x:200}) .call(function(){ trace("hello"); showMessage("goodbye"); }); function showMessage(message:String):void{ trace(message); } 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