Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

onComplete not triggering?

Recommended Posts

Hello. One of my functions doesn't appear to be triggering when I call onComplete. I've looked over the syntax loads, and I've tried a few different things, but 'removeFromStage' just isn't being called no matter what. I've also tried downloading in the latest swc, am I missing something completely obvious?


private function bombExplode():void{

TweenLite.to(bomb_MC, 1, {y:100, onComplete:removeFromStage});



private function removeFromStage():void{

trace("function triggered")


Share this post

Link to post
Share on other sites

Okay, figured this one out. Turns out you can't remove the EventListener for EnterFrame, it effectively removes the functionality of greensock, hope this helps someone else!

Share this post

Link to post
Share on other sites

You can certainly remove your own ENTER_FRAME event listeners - that has no effect on GreenSock stuff. I think you were running into a scope issue, that's all. In your previous code (which apparently you edited), you had this.removeEventListener(...) inside your onComplete function, but "this" probably didn't refer to what you THOUGHT it referred to. Feel free to trace() to see for yourself. You can set the scope inside the onComplete function using onCompleteScope. Like:

TweenLite.to(bomb_MC, 1, {y:100, onComplete:removeFromStage, onCompleteScope:this});

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.