Ultrashock Forums > Flash > ActionScript
tweener and onComplete

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
tweener and onComplete
Old 2009-07-02

Hi Folks,

I am trying to do some simple tweens using Tweener, and am running into a problem regarding onComplete.

My goal is to tween a MC (instance name = MC1) into place (Y axis), then on completion of the tween, the script will execute a second tween on a second MC (instance name = MC2), while the 1st one stays where it was tweened to.

Instead, the 1st MC moves, then moves again, while the 2nd MC does nothing.



My AS3 code is this:
Code:
import caurina.transitions.Tweener;

function moveBar()
 {
Tweener.addTween(MC1, {x: 400, y:431,  time:7.500000E-001 * 2, onComplete:moveBoat, transition:"easeOut"});
 }
 
moveBar();



function moveBoat()
 {
Tweener.addTween(MC2, {x: 400, y:-200,  time:7.500000E-001 * 2, onComplete:finishMeOff});
 }

function finishMeOff()
 {
// more of the same, etc.
 }

Thanks very much for any thoughts,

s'Pk
postbit arrow 2 comments | 356 views postbit arrow Reply: with Quote   
Registered User
sPlatterKep is offline
seperator
Posts: 28
2009-04-16
sPlatterKep lives in United States
seperator

Ultrashock Member Comments:
Isocase's Avatar Isocase Isocase is offline Isocase lives in United States 2009-07-02 #2 Old  
No problems here. Make sure your instance names are correct on your MC's

Code:
import caurina.transitions.Equations;
import caurina.transitions.Tweener;

moveBar();

function moveBar():void {
	Tweener.addTween(MC1, {x: 400, y:300,  time:7, transition:Equations.easeOutSine, onComplete:moveBoat});
}

function moveBoat():void {
	Tweener.addTween(MC2, {x: 400, y:200,  time:7, onComplete:finishMeOff});
}

function finishMeOff():void {
	trace("finishMeOff");
}
Reply With Quote  
sPlatterKep sPlatterKep is offline sPlatterKep lives in United States 2009-07-02 #3 Old  
Hi Isocase,

I'm sure you already know this, but: You are the man!

Thank you very much, it's much appreciated.

Cheers (and happy 4th)

sPk
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: