topical media & game development

talk show tell print

lib-flex-animation-code-10-org-as3lib-kitchensync-action-TweenFactory.ax

lib-flex-animation-code-10-org-as3lib-kitchensync-action-TweenFactory.ax (swf ) [ flash ] flex


  package org.as3lib.kitchensync.action
  {
          import org.as3lib.kitchensync.KitchenSyncDefaults;
          
          
Provides a convenient interface for creating all types of tweens.
author: Mims Wright @since 1.6

  
          final public class @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-action-TweenFactory
          {
                  public static var objectParser:ITweenObjectParser = KitchenSyncDefaults.tweenObjectParser;
                  
                  
Uses a generic object to define parameters for a new tween. See ITweenParser and KitchenSyncObjectParser for more details.
see: ITweenObjectParser
see: KitchenSyncObjectParser
parameter: parameters An object that contains properties that define the new tween
returns: A new tween.

   
                  public static function newTween(parameters:Object):ITween {
                          return objectParser.parseObject(parameters);
                  }
                  
                  
Creates a tween with a TargetProperty as it's tween target.
see: #newWithTweenTarget()
parameter: target - the object whose property will be changed
parameter: property - the name of the property to change. The property must be a Number, int or uint such as a Sprite object's "alpha"
parameter: startValue - the value to tween the property to. After the tween is done, this will be the value of the property.
parameter: endValue - the starting value of the tween. By default, this is the value of the property before the tween begins.
parameter: duration - the time in milliseconds that this tween will take to execute. String values are acceptable too.
parameter: delay - the time to wait in milliseconds before starting the tween. String values are acceptable too.
parameter: easingFunction - the function to use to interpolate the values between fromValue and toValue.

  
                  public static function newWithTargetProperty(target:Object = null, property:String = "", startValue:Number = 0, endValue:Number = 0, duration:* = 0, delay:* = 0, easingFunction:Function = null):KSTween {
                          return new KSTween(target, property, startValue, endValue, duration, delay, easingFunction);
                  }
  
                  
Creates a new KSTween using an ITweenTarget that you pass into it.
parameter: tweenTarget An explicitly defined tweenTarget object (or an array of tweentargets) that contains the values you want to tween.
parameter: duration - the time in frames that this tween will take to execute.
parameter: delay - the time to wait before starting the tween.
parameter: easingFunction - the function to use to interpolate the values between fromValue and toValue.
returns: A new KSTween object.

  
                  public static function newWithTweenTarget(tweenTarget:*, duration:* = 0, delay:* = 0, easingFunction:Function = null):KSTween {
                          return KSTween.newWithTweenTarget(tweenTarget, duration, delay, easingFunction);
                  } 
  
          }
  }


(C) Æliens 19/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.