Hey guys,
So I have this code below.
function myfunction():Void {
for (i = 0; i < 100; i++) {
_root.attachMovie('platform','platform_' + i,i,{_x:275 + i * 100, _y:200});
}
}
myfunction();
_root['platform_' + i].onEnterFrame = function():Void {
_x -= 5;
};
The code generates 5 platforms movieclips and is also placing them on 275x and 200y. There is a space of 100 pixels between each of them. I want to give all of these platforms an action to do, like _x -= 5; but it
simply doesn’t work with what I’ve written.
Could anyone tell me what I’m doing wrong?
Thanks!