Multiple names for inside a MC in Flash

Started by
1 comment, last by Tarrant 16 years, 4 months ago
Hi guys from the net. I have a problem in AS. I want to name multiple var inside a MC. Like this:

 if (avaen_mc.hitTest(jail_mc.limit1_mc)) { ... }
 if (avaen_mc.hitTest(jail_mc.limit2_mc)) { ... }

Instead of going on each limit, I made a for like this:

for (var i=[1]; i<[19]; i++) {
	var nm = "limit" + i + "_mc";
}

But how do I attach it inside the jail_mc? I tried with attachMovie function but didn't work. Thank you guys!
Advertisement
Perhaps it's time to look into arrays, if you aren't already aware of their existence.

Linkage:
Arrays
Multi-Dimensional Arrays and attachMovie
Create-ivity - a game development blog Mouseover for more information.
for (var i=1; i<19; i++) {    if ( avaen_mc.hitTest(jail_mc["limit" + i + "_mc"])) { ... }}

This topic is closed to new replies.

Advertisement