1 | package caurina.transitions {
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * PropertyInfoObj
|
---|
5 | * An object containing the updating info for a given property (its starting value, and its final value)
|
---|
6 | *
|
---|
7 | * @author Zeh Fernando
|
---|
8 | * @version 1.0.0
|
---|
9 | * @private
|
---|
10 | */
|
---|
11 |
|
---|
12 | public class PropertyInfoObj {
|
---|
13 |
|
---|
14 | public var valueStart :Number; // Starting value of the tweening (null if not started yet)
|
---|
15 | public var valueComplete :Number; // Final desired value
|
---|
16 | public var hasModifier :Boolean; // Whether or not it has a modifier function
|
---|
17 | public var modifierFunction :Function; // Modifier function, if any
|
---|
18 | public var modifierParameters :Array; // Additional array of modifier parameters
|
---|
19 |
|
---|
20 | // ==================================================================================================================================
|
---|
21 | // CONSTRUCTOR function -------------------------------------------------------------------------------------------------------------
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Initializes the basic PropertyInfoObj.
|
---|
25 | *
|
---|
26 | * @param p_valueStart Number Starting value of the tweening (null if not started yet)
|
---|
27 | * @param p_valueComplete Number Final (desired) property value
|
---|
28 | */
|
---|
29 | function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_modifierFunction:Function, p_modifierParameters:Array) {
|
---|
30 | valueStart = p_valueStart;
|
---|
31 | valueComplete = p_valueComplete;
|
---|
32 | hasModifier = Boolean(p_modifierFunction);
|
---|
33 | modifierFunction = p_modifierFunction;
|
---|
34 | modifierParameters = p_modifierParameters;
|
---|
35 | }
|
---|
36 |
|
---|
37 |
|
---|
38 | // ==================================================================================================================================
|
---|
39 | // OTHER functions ------------------------------------------------------------------------------------------------------------------
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * Clones this property info and returns the new PropertyInfoObj
|
---|
43 | *
|
---|
44 | * @param omitEvents Boolean Whether or not events such as onStart (and its parameters) should be omitted
|
---|
45 | * @return TweenListObj A copy of this object
|
---|
46 | */
|
---|
47 | public function clone():PropertyInfoObj {
|
---|
48 | var nProperty:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, modifierFunction, modifierParameters);
|
---|
49 | return nProperty;
|
---|
50 | }
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Returns this object described as a String.
|
---|
54 | *
|
---|
55 | * @return String The description of this object.
|
---|
56 | */
|
---|
57 | public function toString():String {
|
---|
58 | var returnStr:String = "\n[PropertyInfoObj ";
|
---|
59 | returnStr += "valueStart:" + String(valueStart);
|
---|
60 | returnStr += ", ";
|
---|
61 | returnStr += "valueComplete:" + String(valueComplete);
|
---|
62 | returnStr += ", ";
|
---|
63 | returnStr += "modifierFunction:" + String(modifierFunction);
|
---|
64 | returnStr += ", ";
|
---|
65 | returnStr += "modifierParameters:" + String(modifierParameters);
|
---|
66 | returnStr += "]\n";
|
---|
67 | return returnStr;
|
---|
68 | }
|
---|
69 |
|
---|
70 | }
|
---|
71 |
|
---|
72 | }
|
---|