for(var i=0;i<10;i++){
var skeet:MovieClip = attachMovie("skeet", "skeet" + i, i);
//position randomly
skeet._x = Math.random()*500+20;
skeet._y = Math.random()*360+20;
//how much he can eat
skeet.capacity = 10;
//how fast he is (higher number = slower movement)
skeet.speed = 10;
// start with an empty stomach
skeet.ate = 0;
skeet.onEnterFrame = eat;
}
Hi i have a for loop that creates 10 of my skeet movieclips at random positions on the stage.
I then have a hitTest that traces a 1, to the output window if the skeet movieClip hits my food movieclip. My variables are then sent thru my server.
However i need to know which skeet out of the ten is hitting the food at that given time.
So that when skeet 1 hits food it sends variable 1 and traces a 1, the same for 2 and so on.
So basically i need to know how to name dynamic movie clips individually, or give them a variable name that they trigger upon creation. Thanks for any advice in advance.
if (this.hitTest(skeet)) {
trace(["1"]);
max.send("; var1 1;");
max.send("; var2 1;");
max.send("; var3 1;");
max.send("; var4 1;");
max.send("; var5 1;");
max.send("; var6 1;");
max.send("; var7 1;");
max.send("; var8 1;");
max.send("; var9 1;");
max.send("; var10 1;");
} else {
max.send("; var1 0;");
max.send("; var2 0;");
max.send("; var3 0;");
max.send("; var4 0;");
max.send("; var5 0;");
max.send("; var6 0;");
max.send("; var7 0;");
max.send("; var8 0;");
max.send("; var9 1;");
max.send("; var10 0;");
}
};