Skip to content

Commit

Permalink
Merge pull request useflashpunk#80 from BlckKnght/motion
Browse files Browse the repository at this point in the history
Motion tween update
  • Loading branch information
Draknek committed Apr 30, 2012
2 parents 1c70f06 + 243a5aa commit 807481a
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions net/flashpunk/tweens/motion/Motion.as
Expand Up @@ -10,12 +10,38 @@
/** /**
* Current x position of the Tween. * Current x position of the Tween.
*/ */
public var x:Number = 0; public function get x():Number { return _x; }
public function set x(value:Number):void
{
_x = value;
if (_object)
_object.x = _x;
}


/** /**
* Current y position of the Tween. * Current y position of the Tween.
*/ */
public var y:Number = 0; public function get y():Number { return _y; }
public function set y(value:Number):void
{
_y = value;
if (_object)
_object.y = _y;
}

/**
* Target object for the tween. Must have an x and a y property.
*/
public function get object():Object { return _object; }
public function set object(value:Object):void
{
_object = value;
if (_object)
{
_object.x = _x;
_object.y = _y;
}
}


/** /**
* Constructor. * Constructor.
Expand All @@ -28,5 +54,9 @@
{ {
super(duration, type, complete, ease); super(duration, type, complete, ease);
} }

protected var _x:Number = 0;
protected var _y:Number = 0;
protected var _object:Object;
} }
} }

0 comments on commit 807481a

Please sign in to comment.