Groups | Blog | Home
all groups > flash actionscript > october 2005 >

flash actionscript : attachMovie problem


Andrew Fitzgerald
10/24/2005 5:24:50 PM
for (var i:Number = 1; i <= 7; i++) {
_root.attachMovie("menu", "menu" + i, i);
var boo:MovieClip = _root["menu" + i];
boo._x = 400;
}

That would probbably work much better.

What you're doing doesn't make any sense. You're making an instance of
the menu, then inside of that mc, you're making another menu instance,
7 times.

Hope that at least cleans up your code.
vncntj
10/24/2005 10:52:44 PM
I have my menu instances coming onto my movie, but (i'm sort of new to this) i
can't figure out how to display them without
var boo:Movie = _root.attachMovie("menu", "menu", i)... being on the canvas..
i just want the instances and not entire boo object
function menuIt() {
if (i<=7) {
i++;
var boo:MovieClip = _root.attachMovie("menu", "menu", i);
boo._x = 400;
new mx.transitions.Tween(boo["menu"+i], "_x",
mx.transitions.easing.Strong.easeOut, 0, 100, 3, true);
//trace(boo["menu"+i])
} else {
}
}
menuIt();
AddThis Social Bookmark Button