在 FlashDevelop(或其他没有图形的 IDE)中更改影片剪辑
我这样做是
[Embed(source = "../lib/hfront.swf")]
private var charfront1Class : Class;
private var charfront1:MovieClip = new charfront1Class;
为了在FlashDevelop中创建一个movieclip对象。因为没有选项(如在 CS5 中)为库对象提供一个固有的类。
我需要做的是能够在我的角色行走时切换正在显示的影片剪辑。我是否必须为每个影片剪辑创建一个单独的类并将它们调入和调出可见性?或者有没有更好的方法,一种“切换”我当前班级指向哪个影片剪辑的方法?
谢谢
I am doing this:
[Embed(source = "../lib/hfront.swf")]
private var charfront1Class : Class;
private var charfront1:MovieClip = new charfront1Class;
in order to create a movieclip object in FlashDevelop. Because there is no option (like in CS5) to give a library object a class inherently.
What I need to do is be able to switch which movie clip is being displayed as my character walks about. Do I have to create a separate class for each movieclip and call them in and out of visibility?? Or is there a better way, a way to "switch" which movie clip my current class is pointing to?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先嵌入不正确。如果您像这样嵌入整个 SWF,您将无法控制其时间线。
要拥有可以操作的 MovieClip,您必须嵌入此 SWF 的符号:
其次,确保您实际为每个动画调用 stop(),否则即使它们不在显示列表中,它们也会运行(并消耗 CPU)。
最后,这是一个(简单的)示例,显示了 2 个嵌入动画(作为扩展 Sprite 的类的子级):
Firstly the embed isn't correct. If you embed an entire SWF like that you won't be able to control its timeline.
To have a MovieClip that you can manipulate you must embed a symbol of this SWF:
Secondly, make sure you actually call stop() for each animation or they will run (and consume CPU) even if they are off the display list.
Finally here's a (naive) example of showing the 2 embedded anims (as children of a class extending Sprite):