Created
October 22, 2013 09:36
-
-
Save RealyUniqueName/7097772 to your computer and use it in GitHub Desktop.
Actuate fails to call setters of classes which extend classes with type parameters. Affected versions: 1.6.3 - 1.7.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import flash.display.Shape; | |
import flash.display.Sprite; | |
import flash.Lib; | |
import motion.Actuate; | |
class Main extends Test<Shape>{ | |
/** this setter is not called on tweening */ | |
public var left (default,set) : Float = 0; | |
static function main() { | |
var test = new Main(); | |
Lib.current.addChild(test); | |
Actuate.tween(test, 3, {left:750}).onUpdate(function(){ | |
//this trace will be displayed | |
trace('tween update: test.left = ' + test.left); | |
}); | |
} | |
/** | |
* Setter `left`. | |
* | |
*/ | |
private function set_left (left:Float) : Float { | |
//this trace will never be displayed | |
trace('setter'); | |
return this.x = this.left = left; | |
}//function set_left | |
} | |
/** | |
* Class with type parameters | |
* | |
*/ | |
class Test<T> extends Sprite{ | |
/** | |
* Constructor | |
* | |
*/ | |
public function new () : Void { | |
super(); | |
this.graphics.beginFill(0xFF0000); | |
this.graphics.drawRect(0, 0, 50, 50); | |
this.graphics.endFill(); | |
}//function new() | |
}//class Test<T> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment