嗨,我正在尝试制作一个对象,在本例中为“ship_mc”,移动到屏幕上的 3 个不同点,但我想使用补间类。我不确定为什么它不起作用,任何帮助将不胜感激。我的代码看起来像这样
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var myTween01:Tween = new Tween(this, "x", Regular.easeIn, 1416, 973, 4, true);
var myTween02:Tween = new Tween(this, "y", Regular.easeIn, 206, 446, 4, true);
var myTween03;
var myTween04;
var myTween05;
var myTween06;
myTween01.addEventListener(TweenEvent.MOTION_FINISH, onFinish);
function onFinish(e:TweenEvent):void {
myTween03:Tween = new Tween(this, "x", None.easeIn, 973, 695, 4, true);
myTween04:Tween = new Tween(this, "y", None.easeIn, 446, 222, 4, true);
}
myTween04.addEventListener(TweenEvent.MOTION_FINISH, onFinish1);
function onFinish1(e:TweenEvent):void {
myTween05:Tween = new Tween(this, "x", None.easeIn, 695, 374, 4, true);
myTween06:Tween = new Tween(this, "y", None.easeIn, 222, 239, 4, true);
}
这是我得到的错误
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 15 1067: Implicit coercion of a value of type fl.transitions:Tween to an unrelated type Class.
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 15 1188: Illegal assignment to class Tween.
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 16 1067: Implicit coercion of a value of type fl.transitions:Tween to an unrelated type Class.
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 16 1188: Illegal assignment to class Tween.
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 22 1067: Implicit coercion of a value of type fl.transitions:Tween to an unrelated type Class.
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 22 1188: Illegal assignment to class Tween.
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 23 1067: Implicit coercion of a value of type fl.transitions:Tween to an unrelated type Class.
Symbol 'ship_mc', Layer 'Actions', Frame 1, Line 23 1188: Illegal assignment to class Tween.
谢谢,我知道人们会建议使用 tweenlite,但我想知道这里有什么问题,否则我不会学习!