2011-03-22 63 views

回答

3

可以右鍵單擊運動補間實例或時間軸上的補間,然後選擇將動作複製爲ActionScript 3.0

Copy Motion as ActionScript 3.0

你再有這樣的事情在你的剪貼板:

import fl.motion.AnimatorFactory; 
import fl.motion.MotionBase; 
import fl.motion.Motion; 
import flash.filters.*; 
import flash.geom.Point; 
var __motion_Symbol1_2:MotionBase; 
if(__motion_Symbol1_2 == null) { 
    __motion_Symbol1_2 = new Motion(); 
    __motion_Symbol1_2.duration = 24; 

    // Call overrideTargetTransform to prevent the scale, skew, 
    // or rotation values from being made relative to the target 
    // object's original transform. 
    // __motion_Symbol1_2.overrideTargetTransform(); 

    // The following calls to addPropertyArray assign data values 
    // for each tweened property. There is one value in the Array 
    // for every frame in the tween, or fewer if the last value 
    // remains the same for the rest of the frames. 
    __motion_Symbol1_2.addPropertyArray("x", [0]); 
    __motion_Symbol1_2.addPropertyArray("y", [0]); 
    __motion_Symbol1_2.addPropertyArray("scaleX", [1.000000]); 
    __motion_Symbol1_2.addPropertyArray("scaleY", [1.000000]); 
    __motion_Symbol1_2.addPropertyArray("skewX", [0]); 
    __motion_Symbol1_2.addPropertyArray("skewY", [0]); 
    __motion_Symbol1_2.addPropertyArray("rotationConcat", [0]); 
    __motion_Symbol1_2.addPropertyArray("cacheAsBitmap", [false]); 

    // Create an AnimatorFactory instance, which will manage 
    // targets for its corresponding Motion. 
    var __animFactory_Symbol1_2:AnimatorFactory = new AnimatorFactory(__motion_Symbol1_2); 
    __animFactory_Symbol1_2.transformationPoint = new Point(0.500000, 0.499773); 

    // Call the addTarget function on the AnimatorFactory 
    // instance to target a DisplayObject with this Motion. 
    // The second parameter is the number of times the animation 
    // will play - the default value of 0 means it will loop. 
    // __animFactory_Symbol1_2.addTarget(<instance name goes here>, 0); 
}