gree / lwf

LWF - Lightweight SWF
http://gree.github.com/lwf/
zlib License
627 stars 167 forks source link

How to creat instance of Movie Clip in unity? #88

Closed ghost closed 10 years ago

ghost commented 10 years ago

I have 1 movie clip( 5 frame of 5 fish). I want to 5 fish in a screen but I only creat 1 fish with 1 movie clip. How to creat instance of movie clip without creat game object?

splhack commented 10 years ago

Try to use LWFObject.AttachMovie API or LWF.Movie.AttachMovie API.

lwfObject.AttachMovie("_root", "fish", "fish0", postLoad(movie) => { ... });
lwfObject.AttachMovie("_root", "fish", "fish1", postLoad(movie) => { ... });

In this case, the first argument "_root" is the target movie clip where a new movie clip will be attached on. the second argument "fish" is the linkage name what you set in Flash library. the third argument "fish0" and "fish1" are instance name.

ghost commented 10 years ago

postLoad(movie) => { ... } : error in this. What is I can add in argument ?

splhack commented 10 years ago

whatever you want. If you don't have, just

lwfObject.AttachMovie("_root", "fish", "fish0");
ghost commented 10 years ago

Thanks you very much !