如何动态设置补间标识符。我试过eval,但它说我需要在赋值运算符的左边有一个变量。这是我试过的:
eval ("TweenAX" + circle.current.arrowHead.count) = new Tween(circle.current.arrowHead, "_x", mx.transitions.easing.Strong.easeOut, circle.current._x, Stage.width/2, 2, true);
eval ("TweenAY" + circle.current.arrowHead.count) = new Tween(circle.current.arrowHead, "_y", mx.transitions.easing.Strong.easeOut, circle.current._y, Stage.height/2, 2, true);
干杯
答案 0 :(得分:0)
我并非100%确定我理解您要实现的目标,但我认为您正在寻找括号语法:
this["TweenAX" + circle.current.arrowHead.count] = new Tween(circle.current.arrowHead, "_x", mx.transitions.easing.Strong.easeOut, circle.current._x, Stage.width/2, 2, true);
this["TweenAY" + circle.current.arrowHead.count] = new Tween(circle.current.arrowHead, "_y", mx.transitions.easing.Strong.easeOut, circle.current._y, Stage.height/2, 2, true);
这将在名为this
和TweenAXN
的{{1}}上创建两个属性,其中TweenAYN
是N
的值