How do I duplicate a MovieClip?
Can anyone tell me how to duplicate a MovieClip in A开发者_开发技巧ctionScript 3 in Flash CS4?
If you mean you want to duplicate a movie clip in the Flash CS4 IDE, it is really trivial, simply right click on the movie clip either in the library or on the stage and select Duplicate. That will create another movie clip in the library which is identical to the one you have. If you only want to have more than one of the same movie clip, you can ctrl click + drag or simply drop the same movie clip more then once from the library to the stage.
On the other hand, if you want to duplicate a movie clip in code, then follow the tutorial on this website: http://www.smithmediafusion.com/blog/?p=446
The tutorial is for CS3, but it is 99% similar in CS4:
- Right Click on the movie clip in the library and select Properties
- In the property box that appears, click on Advanced
- Then select Export for ActionScript and refer to the tutorial at the link I gave you for the rest.
If you want an actual way to recreate the depcrecated function duplicateMovieClip from AS2 refer to this forum post: http://www.kirupa.com/forum/showthread.php?p=1939827
精彩评论