View Full Version : duplicated clips - first post
06-18-2007, 05:59 AM
what is the best practice in duplication movie clips in a for loop? i've always used duplicateMovieClip with eval("mc_name"+i)
do u duplicateMovieClip(), attachmovie, or something else? i saw something like this i think
how is this done? can someone explain what they think is the easiest to create and work with technique to duplicate and modify movie clips in loops.
06-18-2007, 10:23 AM
most movieclip functions like duplicatemovieclip, atatchMovie createemptymovieclip etc return a refrence to the clip you just created.
that is taking the parent clip (named clip) and searching for a name as part of a hash. this is not a good practise, albeit unavoidable at times as clip[name] is not typed meaning the compiler in as2 will not know if the property_x exists on it (meaning it can fail silently). and in as3 if a class is not declared as dynamic that will through an error and if it is declared as dynamic it will just be slow.
the easiest is not the best in this case.
what editor do you use for your coding?>
06-18-2007, 09:21 PM
06-19-2007, 09:02 AM
does it have templates. fdt came with a static create function template for movieclips which was good and encapsulated some good principles
06-19-2007, 12:05 PM
Best Practice is the new syntax which Hangalot showed. See the Advanced Pathing tutorial which explains how to use it in depth.
vBulletin® v3.8.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.