I made a very simple catching game in flash. The thing is that when I select Air for Android (I've tried with versions 3.2, 3.9 and 4.0) as target publish everything works well. But if I change it to Flash player 10 or 11 it starts "missing" some catches. Any ideas? Here is my code, it just adds come "ball" movieclips from library and drop them in the stage. There is a movieclip that moves with the mouse and catches them.
import flash.events.Event;
var intervaloPelotas = setInterval(addBall, 1000);
var pelotas:Array = [];
var points:Number = 0;
function addBall(){
var b:Ball = new Ball();
b.x = Math.ceil(Math.random()*500);
b.y = -50;
addChild(b);
pelotas.push(b);
b.addEventListener(Event.ENTER_FRAME, dropBall);
}
function dropBall(e:Event){
var b:Ball = Ball(e.target);
b.y += 10;
if(b.y > 400){
eliminarPelota(b);
}
}
stage.addEventListener(Event.ENTER_FRAME, mueveHeroe);
function mueveHeroe(e:Event){
heroe.x = mouseX;
for(var i:int=0; i<pelotas.length; i++){
if(heroe.hitTestObject(pelotas[i])){
eliminarPelota(pelotas[i]);
//Sumar un punto
points++;
puntosTxt.text = String(points);
}
}
}
function eliminarPelota(p){
p.removeEventListener(Event.ENTER_FRAME, dropBall);
removeChild(p);
}