Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

action script 3, move a movieclip on X or Y axis with a onMotionFinished

Explorer ,
Nov 08, 2013 Nov 08, 2013

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.

TOPICS
ActionScript
816
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 08, 2013 Nov 08, 2013

:

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);

}

Translate
Community Expert ,
Nov 08, 2013 Nov 08, 2013

:

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);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2013 Nov 08, 2013

Thanks that worked prefectly

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 08, 2013 Nov 08, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines