Alexandr_1983
12.08.2012, 13:40
z динамически создаю 30 объктов (вишен). как мне к ним по отдельности обратиься т.е. написать для каждой отдельное событие. Они все откликаются на одно и тоже событие
for (var j:uint = 1; j < 30; j++){
R_x=Math.round((Math.random()*600));
R_y=Math.round((Math.random()*-2000));
if (R_x>=100 && R_x<=500){
var mc:cherry = new cherry();
addChild(mc);
mc.addEventListener(Event.ENTER_FRAME, animate);
mc.x=R_x;
mc.y=R_y;
}
else {
--j;
}
for (var j:uint = 1; j < 30; j++){
R_x=Math.round((Math.random()*600));
R_y=Math.round((Math.random()*-2000));
if (R_x>=100 && R_x<=500){
var mc:cherry = new cherry();
addChild(mc);
mc.addEventListener(Event.ENTER_FRAME, animate);
mc.x=R_x;
mc.y=R_y;
}
else {
--j;
}