AS2:动态补间标识符
我如何动态设置补间标识符。我尝试过 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);
干杯
How do i go about setting the tween identifier dynamically. I have tried eval but it says I need a variable on the left of the assignment operator. here's what I tried:
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);
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是 100% 确定我理解您想要实现的目标,但我认为您正在寻找括号语法:
这将在
this
上创建两个名为TweenAXN
和TweenAYN
,其中N
是circle.current.arrowHead.count
的值I'm not 100% sure I understand what you are trying to achieve, but I think you're looking for the bracket syntax:
This will create two properties on
this
namedTweenAXN
andTweenAYN
whereN
is the value ofcircle.current.arrowHead.count