TweenEvent.MOTION_FINISH


i trying learn oop in 3.0. have multiple tweens want apply 1 right after other want control tweens based on previous being complete. can control within class file trying control outside of class file. here code in class file:

package {
import flash.display.sprite;
import fl.transitions.tween;
import fl.transitions.easing.*;
import fl.transitions.*;

public class website extends sprite {
public var isfinished = false;

function website():void {

}
public function resizemc(mc:sprite):void {
//trace(mc);
var mytweenscalex:tween = new tween(mc, "scalex", elastic.easeout, 1, 2, 4, true);


function finishhandler(event:tweenevent):void {
// place actions here
trace("motion_finish time = "+event.time);
isfinished = true;
}
var mytweenscaley:tween = new tween(mc, "scaley", elastic.easeout, 1, 2, 4, true);
mytweenscaley.addeventlistener(tweenevent.motion_finish, finishhandler);

}
public function repositionmc(mc:sprite):void {
var mytweenx:tween = new tween(mc, "x", elastic.easeout, 0, 200, 4, true);
var mytweeny:tween = new tween(mc, "y", elastic.easeout, 0, 200, 4, true);
}
}
}


and here code in flash timeline:

var website:website = new website();
website.resizemc(box);


while(website.isfinished==true){
website.repositionmc(box);
}



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support