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

MotionBase - Adobe ActionScript® 3 (AS3 Flash)

Explorer ,
Aug 13, 2013 Aug 13, 2013

Этот вопрос был задан по поводу следующей статьи: http://help.adobe.com/ru_RU/FlashPlatform/reference/actionscript/3/fl/motion/MotionBase.html

TOPICS
ActionScript
361
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
New Here ,
Aug 13, 2013 Aug 13, 2013
LATEST

package

{

import flash.display.MovieClip;

import flash.display.Sprite;

import fl.motion.AnimatorFactory;

import fl.motion.MotionBase;

import flash.geom.Point;

import fl.motion.Motion;

public class MotionBaseExample extends MovieClip

{

private var motionBase:MotionBase;

private var animFactory:AnimatorFactory;

private var size:uint = 100;

private var bgColor:uint = 0xFFCC00;

public function MotionBaseExample():void

{

var boxObj:Sprite = new Sprite();

boxObj.graphics.beginFill(bgColor);

boxObj.graphics.drawRect(0, 0, size, size);

boxObj.graphics.endFill();

addChild(boxObj);

motionBase = new Motion();

motionBase.duration = 20;

motionBase.addPropertyArray("x",[0,50,95,134,169,199,225,247,265,280]);

motionBase.addPropertyArray("y",[0,1,0,4,12,21,32,44,52,38]);

animFactory = new AnimatorFactory(motionBase);

animFactory.transformationPoint = new Point(2, 2);

animFactory.addTarget(boxObj, 0);

}

}

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