以下代码返回以下运行时错误。为什么?
代码:
package
{
import flash.display.Sprite;
import fl.transitions.Tween;
import fl.transitions.easing.Regular;
import fl.transitions.TweenEvent;
public class Test extends Sprite
{
private var myNumber:Number;
private var myTween:Tween;
public function Test()
{
myNumber = -12;
myTween = new Tween(this, "myNumber", Regular.easeIn, myNumber, 0, 5, true);
myTween.addEventListener(TweenEvent.MOTION_CHANGE, tweenChangeEventHandler);
}
private function tweenChangeEventHandler(evt:TweenEvent):void
{
trace(myNumber)
}
}
}
运行时错误:
ReferenceError: Error #1056: Cannot create property myNumber on Test.
at fl.transitions::Tween/setPosition()
at fl.transitions::Tween/set position()
at fl.transitions::Tween()
at Test()