在ActionScript3.0中从一个点到另一个点绘制一条线
假设我有两个对象,我想使用动作脚本来绘制一条连接它们的线,该线会在它们移动/拖动时自动更新。 谁能告诉我如何做到这一点,以及如何控制线条的参数,如颜色、重量等? 任何答案将不胜感激!
Lets say I have two objects, and I want to use action script to draw a line connecting them, which will update automatically as they are moved/ dragged.
Can anyone show me how to do that, and also how to control line's parameters like colour, weight etc?
Any answer would be highly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的两个影片剪辑
mc1
和mc2
在 ENTER_FRAME 事件上共享同一个父级:mcParent
,您可以这样做:您可以更改动画的外观通过更改 线条样式。
干杯!
Let's say your two movieclips
mc1
andmc2
share the same parent:mcParent
on an ENTER_FRAME event you would do:You can change the aspect of the stroke by changing the parameters of lineStyle.
Cheers!