UDN
Search public documentation:

CLIKScriptedAnimation
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > User Interfaces & HUDs > Scaleform GFx > How to create tween animations in ActionScript or UnrealScript

How to create tween animations in ActionScript or UnrealScript


ALERT! Note: Avoid mixing time line animation with ActionScript tweening, as you may get unwanted results.

Tweening animation in ActionScript


ActionScript
  _global.gfxExtensions = true; // this line is only necessary if you wish to tween on the Z axis (in 3D).
  import gfx.motion.Tween;
  import mx.transitions.easing.*;
  
  Tween.init(); // this line adds tween functionality to all movie clips.
  
  MyMovieClip.tweenTo(3, {_x:250, _y:250, _z:-5000, _alpha:50}, Strong.easeOut);
  

  • tweenTo() - Tweens from the position of the object on the stage to the position given by the properties in the code.
    • Duration in seconds
    • Object containing destination X
    • Object containing destination Y
    • Object containing destination Z
    • Alpha
    • Etc.
    • Tween type and method
      • Tween types
        • Back
        • Bounce
        • Elastic
        • Regular
        • Strong
        • None
      • Tween methods
        • easeIn
        • easeOut
        • easeInOut
  • tweenFrom() - tweens from the properties given in the code to the position of the object on the stage.
    • Duration in seconds
    • Object containing source X
    • Object containing source Y
    • Object containing source Z
    • Alpha
    • Etc.
    • Tween type and method
      • Tween types
        • Back
        • Bounce
        • Elastic
        • Regular
        • Strong
        • None
      • Tween methods
        • easeIn
        • easeOut
        • easeInOut
  • tweenEnd() - Jumps to the end of the tween, ending it immediately.

Tweening Animation in UnrealScript


Unrealscript
  TweenTo(ArsenalMC, 0.5, "_z", -1500.0, TWEEN_EaseOut, "SomeFunction");
  

  • TweenTo() - Tweens from the position of the object on the stage to the position given by the properties in the code.
    • MovieClip Reference as a GFxObject
    • Duration in seconds as a float
    • Property to tween as a string
    • Value to tween to as a float
    • Tween type as a constant
    • (optional) Function to execute when finished as a string