开发者

Instantiate multiple instances of exported MovieClip then animate them?

开发者 https://www.devze.com 2023-01-22 11:59 出处:网络
I have a movieclip created in the IDE exported to Actionscript via the Library panel (Linkage?). I instatiate multiple instances of it via a loop on the timeline.

I have a movieclip created in the IDE exported to Actionscript via the Library panel (Linkage?).

I instatiate multiple instances of it via a loop on the timeline.

I want to move them around randomly via Actionscript. How do I do that? I tried using listeners, but I have no way to store values to make each movement 开发者_Python百科unique.

(edited to be more clear)


It’s a little unclear what you are trying to do, but here are a couple quick suggestions that might help:

You can code a class for your MovieClip. Create a .as class file with the same name as the Export class name in the IDE. In that class you can keep track of whatever values you need and create animation functions.

If that’s overkill for what you are trying to do, you can always just create properties on the MovieClips at runtime. MovieClips are dynamic, so you can just do:

myClipInstance.speed = 3;  
myClipInstance.direction = 45;

To store the values. You’d retrieve them the same way when you want to update the animation.

If you can clarify what you’re trying to achieve we might be able to help more.

0

精彩评论

暂无评论...
验证码 换一张
取 消