PropertyInfoObj.as 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package caurina.transitions {
  2. /**
  3. * PropertyInfoObj
  4. * An object containing the updating info for a given property (its starting value, and its final value)
  5. *
  6. * @author Zeh Fernando
  7. * @version 1.0.0
  8. * @private
  9. */
  10. public class PropertyInfoObj {
  11. public var valueStart :Number; // Starting value of the tweening (null if not started yet)
  12. public var valueComplete :Number; // Final desired value
  13. public var originalValueComplete :Object; // Final desired value as declared initially
  14. public var arrayIndex :Number; // Index (if this is an array item)
  15. public var extra :Object; // Additional parameters, used by some special properties
  16. public var isSpecialProperty :Boolean; // Whether or not this is a special property instead of a direct one
  17. public var hasModifier :Boolean; // Whether or not it has a modifier function
  18. public var modifierFunction :Function; // Modifier function, if any
  19. public var modifierParameters :Array; // Additional array of modifier parameters
  20. // ==================================================================================================================================
  21. // CONSTRUCTOR function -------------------------------------------------------------------------------------------------------------
  22. /**
  23. * Initializes the basic PropertyInfoObj.
  24. *
  25. * @param p_valueStart Number Starting value of the tweening (null if not started yet)
  26. * @param p_valueComplete Number Final (desired) property value
  27. */
  28. function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_originalValueComplete:Object, p_arrayIndex:Number, p_extra:Object, p_isSpecialProperty:Boolean, p_modifierFunction:Function, p_modifierParameters:Array) {
  29. valueStart = p_valueStart;
  30. valueComplete = p_valueComplete;
  31. originalValueComplete = p_originalValueComplete;
  32. arrayIndex = p_arrayIndex;
  33. extra = p_extra;
  34. isSpecialProperty = p_isSpecialProperty;
  35. hasModifier = Boolean(p_modifierFunction);
  36. modifierFunction = p_modifierFunction;
  37. modifierParameters = p_modifierParameters;
  38. }
  39. // ==================================================================================================================================
  40. // OTHER functions ------------------------------------------------------------------------------------------------------------------
  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, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
  49. return nProperty;
  50. }
  51. /**
  52. * Returns this object described as a String.
  53. *
  54. * @return String The description of this object.
  55. */
  56. public function toString():String {
  57. var returnStr:String = "\n[PropertyInfoObj ";
  58. returnStr += "valueStart:" + String(valueStart);
  59. returnStr += ", ";
  60. returnStr += "valueComplete:" + String(valueComplete);
  61. returnStr += ", ";
  62. returnStr += "originalValueComplete:" + String(originalValueComplete);
  63. returnStr += ", ";
  64. returnStr += "arrayIndex:" + String(arrayIndex);
  65. returnStr += ", ";
  66. returnStr += "extra:" + String(extra);
  67. returnStr += ", ";
  68. returnStr += "isSpecialProperty:" + String(isSpecialProperty);
  69. returnStr += ", ";
  70. returnStr += "hasModifier:" + String(hasModifier);
  71. returnStr += ", ";
  72. returnStr += "modifierFunction:" + String(modifierFunction);
  73. returnStr += ", ";
  74. returnStr += "modifierParameters:" + String(modifierParameters);
  75. returnStr += "]\n";
  76. return returnStr;
  77. }
  78. }
  79. }