Copy link to clipboard
Copied
So ive been using this code in actionScript 2 and now need to use actionScript 3 So i can use the 3d tool
import mx.transitions.Tween;
import mx.transitions.easing.*;
function squareEnter() {
var myTween:Tween = new Tween(square, "_y", None.easeInOut, square._y, square._y+100, 20, false);
myTween.onMotionFinished = function() {
var squarex:Tween = new Tween(square, "_x", None.easeInOut, square._x, square._x+100, 20, false);
};
}
What is the actionScript 3 way of coding this. Everytime I search for the answer i find answers that have way more information then I want or can understand.
:
import fl.transitions.Tween;
import fl.transitions.easing.None;import fl.transitions.TweenEvent
var myTween:Tween;
var squarex:Tween;
function squareEnter() :void{
myTween= new Tween(square, "y", None.easeInOut, square.y, square.y+100, 20, false);
myTween.addEventListener(TweenEvent.MOTION_FINISH,finishF);function finishF(e:TweenEvent):void {
squarex = new Tween(square, "x", None.easeInOut, square.x, square.x+100, 20, false);
}
Copy link to clipboard
Copied
:
import fl.transitions.Tween;
import fl.transitions.easing.None;import fl.transitions.TweenEvent
var myTween:Tween;
var squarex:Tween;
function squareEnter() :void{
myTween= new Tween(square, "y", None.easeInOut, square.y, square.y+100, 20, false);
myTween.addEventListener(TweenEvent.MOTION_FINISH,finishF);function finishF(e:TweenEvent):void {
squarex = new Tween(square, "x", None.easeInOut, square.x, square.x+100, 20, false);
}
Copy link to clipboard
Copied
Thanks that worked prefectly
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now