Jump to content
Search Community

oncomplete will not work

ThomW test
Moderator Tag

Recommended Posts

I would like to use this tween, but the oncomplete function won't start.

is there anything i do wrong?

 

my code:

 

function zoomOut (full_mc):void {

var sw = stage.stageWidth;

var sh = stage.stageHeight;

full_mc.buttonMode = false;

full_mc.removeEventListener(MouseEvent.MOUSE_MOVE, panning);

 

TweenMax.to(full_mc, 1.5, {transformAroundCenter:{x:sw/2, y:sh/2, ease:Expo.easeOut, scale:zoomFactor-=0.25, onComplete:onFinishTween}});

trace(zoomFactor);

 

function onFinishTween():void {

full_mc.addEventListener(MouseEvent.MOUSE_MOVE, panning);

trace(isPanning);

}

}

 

you're welcome !

Thom.

Link to comment
Share on other sites

thanks for your support carl.

 

hmmm, i tried this also, but it won't execute the function also:

 

function zoomOut (full_mc):void {

var sw = stage.stageWidth;

var sh = stage.stageHeight;

full_mc.buttonMode = false;

full_mc.removeEventListener(MouseEvent.MOUSE_MOVE, panning);

 

TweenMax.to(full_mc, 1.5, {transformAroundCenter:{x:sw/2, y:sh/2, ease:Expo.easeOut, scale:zoomFactor-=0.25, onComplete:onFinishTween}});

trace(zoomFactor);

}

 

function onFinishTween():void {

full_mc.addEventListener(MouseEvent.MOUSE_MOVE, panning);

trace(isPanning);

}

 

i don't know what's wrong with this...

what i wanno do is disable the panning while zooming is on.

 

thanks anyway !

Link to comment
Share on other sites

oh, now I see, your onComplete and ease needs to be moved outside the transformAroundCenter vars

 

bad:

TweenMax.to(full_mc, 1.5, {transformAroundCenter:{x:sw/2, y:sh/2, ease:Expo.easeOut, scale:zoomFactor-=0.25, onComplete:onFinishTween}});

 

good:

TweenMax.to(full_mc, 1.5, {transformAroundCenter:{x:sw/2, y:sh/2, scale:zoomFactor-=0.25} , ease:Expo.easeOut, onComplete:onFinishTween} );

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...