On reflection some of the ideas I had are a bit messy - this has probably come from mixing stuff in with legacy code for a year - but Ted's solution looks quite nice and elegant without attaching extra properties to the clips :)

Paul Andrews wrote:
I haven't really followed this thread that closely, but I do see a lot of complication about naming a lot of clips and later trying to access them by reconstructing the correct name.

I generally try and avoid doing this kind of "name reconstruction" where a lot of clips are involved in some kind of sequence or pattern.

If we are talking about 50 clips, perhaps named "C1" to "C50", I would generally try and arrange for these to be referenced through an array.

Perhaps something like myClips:Array = [C1, C2, C3, C4, C5, C6 .. etc ];

If you are creating clips dynamically, just push the clip reference onto the array - myClips.push( someClip);

This saves a lot of messy code because you don't have to manipulate strings, just refer to the correct array element -

for (var idx:Number = 0; idx<myClips.length;idx++){

myClips[idx]._x=idx*50; //whatever

}

Something to consider.

Paul
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to