📄 tweenlitevars.as
字号:
"_frameLabel",
"_glowFilter",
"_hexColors",
"_orientToBezier",
"_quaternions",
"_removeTint",
"_setSize",
"_shortRotation",
"_tint",
"_transformAroundCenter",
"_transformAroundPoint",
"_visible",
"_volume",
"_exposedVars"];
for (i = special.length - 1; i > -1; i--) {
$protectedVars[special[i]] = this[special[i]];
}
for (p in this) {
$vars[p] = this[p]; //add all the dynamic properties.
}
}
//---- GETTERS / SETTERS -------------------------------------------------------------------------------------------------------------
/**
* @return Exposes enumerable properties.
*/
public function get exposedVars():Object {
var o:Object = {}, p:String;
for (p in _exposedVars) {
o[p] = _exposedVars[p];
}
for (p in this) {
o[p] = this[p]; //add all the dynamic properties.
}
return o;
}
/**
* @param $n Same as changing the "alpha" property but with the additional feature of toggling the "visible" property to false when alpha is 0.
*/
public function set autoAlpha($n:Number):void {
_autoAlpha = _exposedVars.autoAlpha = $n;
}
public function get autoAlpha():Number {
return _autoAlpha;
}
/**
* @param $a An Array containing numeric end values of the target Array. Keep in mind that the target of the tween must be an Array with at least the same length as the endArray.
*/
public function set endArray($a:Array):void {
_endArray = _exposedVars.endArray = $a;
}
public function get endArray():Array {
return _endArray;
}
/**
* @param $b To remove the tint from a DisplayObject, set removeTint to true.
*/
public function set removeTint($b:Boolean):void {
_removeTint = _exposedVars.removeTint = $b;
}
public function get removeTint():Boolean {
return _removeTint;
}
/**
* @param $b To set a DisplayObject's "visible" property at the end of the tween, use this special property.
*/
public function set visible($b:Boolean):void {
_visible = _exposedVars.visible = $b;
}
public function get visible():Boolean {
return _visible;
}
/**
* @param $n Tweens a MovieClip to a particular frame.
*/
public function set frame($n:int):void {
_frame = _exposedVars.frame = $n;
}
public function get frame():int {
return _frame;
}
/**
* @param $n Tweens a MovieClip to a particular frame.
*/
public function set frameLabel($s:String):void {
_frameLabel = _exposedVars.frameLabel = $s;
}
public function get frameLabel():String {
return _frameLabel;
}
/**
* @param $n To change a DisplayObject's tint, set this to the hex value of the color you'd like the DisplayObject to end up at(or begin at if you're using TweenLite.from()). An example hex value would be 0xFF0000. If you'd like to remove the tint from a DisplayObject, use the removeTint special property.
*/
public function set tint($n:uint):void {
_tint = _exposedVars.tint = $n;
}
public function get tint():uint {
return _tint;
}
/**
* @param $n To change a MovieClip's (or SoundChannel's) volume, just set this to the value you'd like the MovieClip to end up at (or begin at if you're using TweenLite.from()).
*/
public function set volume($n:Number):void {
_volume = _exposedVars.volume = $n;
}
public function get volume():Number {
return _volume;
}
/**
* @param $f Applies a BevelFilter tween (use the BevelFilterVars utility class to define the values).
*/
public function set bevelFilter($f:BevelFilterVars):void {
_bevelFilter = _exposedVars.bevelFilter = $f;
}
public function get bevelFilter():BevelFilterVars {
return _bevelFilter;
}
/**
* @param $a Array of Objects, one for each "control point" (see documentation on Flash's curveTo() drawing method for more about how control points work). In this example, let's say the control point would be at x/y coordinates 250,50. Just make sure your my_mc is at coordinates 0,0 and then do: TweenMax.to(my_mc, 3, {_x:500, _y:0, bezier:[{_x:250, _y:50}]});
*/
public function set bezier($a:Array):void {
_bezier = _exposedVars.bezier = $a;
}
public function get bezier():Array {
return _bezier;
}
/**
* @param $a Identical to bezier except that instead of passing Bezier control point values, you pass values through which the Bezier values should move. This can be more intuitive than using control points.
*/
public function set bezierThrough($a:Array):void {
_bezierThrough = _exposedVars.bezierThrough = $a;
}
public function get bezierThrough():Array {
return _bezierThrough;
}
/**
* @param $f Applies a BlurFilter tween (use the BlurFilterVars utility class to define the values).
*/
public function set blurFilter($f:BlurFilterVars):void {
_blurFilter = _exposedVars.blurFilter = $f;
}
public function get blurFilter():BlurFilterVars {
return _blurFilter;
}
/**
* @param $f Applies a ColorMatrixFilter tween (use the ColorMatrixFilterVars utility class to define the values).
*/
public function set colorMatrixFilter($f:ColorMatrixFilterVars):void {
_colorMatrixFilter = _exposedVars.colorMatrixFilter = $f;
}
public function get colorMatrixFilter():ColorMatrixFilterVars {
return _colorMatrixFilter;
}
/**
* @param $ct Applies a ColorTransform tween (use the ColorTransformVars utility class to define the values).
*/
public function set colorTransform($ct:ColorTransformVars):void {
_colorTransform = _exposedVars.colorTransform = $ct;
}
public function get colorTransform():ColorTransformVars {
return _colorTransform;
}
/**
* @param $f Applies a DropShadowFilter tween (use the DropShadowFilterVars utility class to define the values).
*/
public function set dropShadowFilter($f:DropShadowFilterVars):void {
_dropShadowFilter = _exposedVars.dropShadowFilter = $f;
}
public function get dropShadowFilter():DropShadowFilterVars {
return _dropShadowFilter;
}
/**
* @param $f Applies a GlowFilter tween (use the GlowFilterVars utility class to define the values).
*/
public function set glowFilter($f:GlowFilterVars):void {
_glowFilter = _exposedVars.glowFilter = $f;
}
public function get glowFilter():GlowFilterVars {
return _glowFilter;
}
/**
* @param $o Although hex colors are technically numbers, if you try to tween them conventionally, you'll notice that they don't tween smoothly. To tween them properly, the red, green, and blue components must be extracted and tweened independently. TweenMax makes it easy. To tween a property of your object that's a hex color to another hex color, use this special hexColors property of TweenMax. It must be an OBJECT with properties named the same as your object's hex color properties. For example, if your my_obj object has a "myHexColor" property that you'd like to tween to red (0xFF0000) over the course of 2 seconds, do: TweenMax.to(my_obj, 2, {hexColors:{myHexColor:0xFF0000}}); You can pass in any number of hexColor properties.
*/
public function set hexColors($o:Object):void {
_hexColors = _exposedVars.hexColors = $o;
}
public function get hexColors():Object {
return _hexColors;
}
/**
* @param $a A common effect that designers/developers want is for a MovieClip/Sprite to orient itself in the direction of a Bezier path (alter its rotation). orientToBezier makes it easy. In order to alter a rotation property accurately, TweenMax needs 4 pieces of information:
*
* 1. Position property 1 (typically "x")
* 2. Position property 2 (typically "y")
* 3. Rotational property (typically "rotation")
* 4. Number of degrees to add (optional - makes it easy to orient your MovieClip/Sprite properly)
*
* The orientToBezier property should be an Array containing one Array for each set of these values. For maximum flexibility, you can pass in any number of Arrays inside the container Array, one for each rotational property. This can be convenient when working in 3D because you can rotate on multiple axis. If you're doing a standard 2D x/y tween on a bezier, you can simply pass in a boolean value of true and TweenMax will use a typical setup, [["x", "y", "rotation", 0]]. Hint: Don't forget the container Array (notice the double outer brackets)
*/
public function set orientToBezier($a:*):void {
if ($a is Array) {
_orientToBezier = _exposedVars.orientToBezier = $a;
} else if ($a == true) {
_orientToBezier = _exposedVars.orientToBezier = [["x", "y", "rotation", 0]];
} else {
_orientToBezier = null;
delete _exposedVars.orientToBezier;
}
}
public function get orientToBezier():* {
return _orientToBezier;
}
/**
* @param $q An object with properties that correspond to the quaternion properties of the target object. For example, if your my3DObject has "orientation" and "childOrientation" properties that contain quaternions, and you'd like to tween them both, you'd do: {orientation:myTargetQuaternion1, childOrientation:myTargetQuaternion2}. Quaternions must have the following properties: x, y, z, and w.
*/
public function set quaternions($q:Object):void {
_quaternions = _exposedVars.quaternions = $q;
}
public function get quaternions():Object {
return _quaternions;
}
/**
* @param $o An object containing a "width" and/or "height" property which will be tweened over time and applied using setSize() on every frame during the course of the tween.
*/
public function set setSize($o:Object):void {
_setSize = _exposedVars.setSize = $o;
}
public function get setSize():Object {
return _setSize;
}
/**
* @param $o To tween any rotation property (even multiple properties) of the target object in the shortest direction, use shortRotation. For example, if myObject.rotation is currently 170 degrees and you want to tween it to -170 degrees, a normal rotation tween would travel a total of 340 degrees in the counter-clockwise direction, but if you use shortRotation, it would travel 20 degrees in the clockwise direction instead. Pass in an object in with properties that correspond to the rotation values of the target, like {rotation:-170} or {rotationX:-170, rotationY:50}
*/
public function set shortRotation($o:Object):void {
_shortRotation = _exposedVars.shortRotation = $o;
}
public function get shortRotation():Object {
return _shortRotation;
}
/**
* @param $tp Applies a transformAroundCenter tween (use the TransformAroundCenterVars utility class to define the values).
*/
public function set transformAroundCenter($tp:TransformAroundCenterVars):void {
_transformAroundCenter = _exposedVars.transformAroundCenter = $tp;
}
public function get transformAroundCenter():TransformAroundCenterVars {
return _transformAroundCenter;
}
/**
* @param $tp Applies a transformAroundPoint tween (use the TransformAroundPointVars utility class to define the values).
*/
public function set transformAroundPoint($tp:TransformAroundPointVars):void {
_transformAroundPoint = _exposedVars.transformAroundPoint = $tp;
}
public function get transformAroundPoint():TransformAroundPointVars {
return _transformAroundPoint;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -