0

I'm trying to trace a simple tween using Tweener, but the onComplete doesn't seem to work. Am I doing something wrong?

import caurina.transitions.*;

addEventListener(Event.ENTER_FRAME, enterFrameHandler);

function enterFrameHandler(event:Event):void {
    Tweener.addTween(block_mc, {rotationY:180, time:1, onComplete:flipInitComplete});
}

function flipInitComplete(e:Event):void {
    trace("hello");
}
2
  • Are you adding a new tween every on every frame for a reason?
    – J. Holmes
    Oct 31, 2011 at 3:23
  • I just want the rotation to happen once on enterframe?
    – muudless
    Oct 31, 2011 at 3:24

2 Answers 2

1

You could think of Tweener as acting independently of the timeline, much like a Timer. You don't need to call Tweener.addTween() every frame. Just call it once and it will run. Right now your Tweener never completes because you keep restarting the Tween every frame.

1
  • Thanks!! I'm over thinking as usual.
    – muudless
    Oct 31, 2011 at 3:40
1

try this:

function enterFrameHandler(event:Event):void {
    Tweener.addTween(block_mc, {rotationY:180, time:1, onComplete:flipInitComplete});


function flipInitComplete():void {
    trace("hello");
} // end flipInitComplete

}//end enterFrameHandler

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.