On 10/28/05, Jorge Rego <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> I have some MCs named mc1, mc2, mc3 ...
> I'm trying to access them like this:
>
> mc[number].someProperty ... but no luck!
>
> How can this be done!?

*sigh*... There really should be a FlashCoders FAQ.

You could do it like this:
theParentOfYourMCs[ "mc" + number ].someProperty, but really, better
loop through an array:

var myMCs:Array = [ "mc1", "mc2", "mc3", ..., "mcN" ];
for( var i:String in myMCs )
  myMCs[ i ].someProperty...

That way you could give them meaningful names (e.g. topLeft,
topRight...), or just push them on the array while you place them on
stage dynamically.

hth,
mark

--
http://snafoo.org/
jabber: [EMAIL PROTECTED]
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to