hello there i am having a problem with a mobile application i am building. It is working just fine with no errors or lag on my computer.however, when i export it for my droid, one of the lose functions ceases to work altogether, causing the game to freeze and me manually ending the app. I’ve checked the code over and over but with no luck, am at lost on how to fix this.
I use this code to call the lose function when these conditions are met:
if(imHit >= 24)
{
loseGameNow();
}
if(noThugs && enemyTwo)
{
windowHit_mc.gotoAndStop(2);
timed += (1/30);
}
if(!noThugs && counter >= 15 || timed >= 5)
{
if(musicOn)
{
newSong.stop();
}
door_mc.gotoAndStop(2);
longBoard.alpha = 0;
if(enemyTwo)
{
windowHit_mc.enemy2_mc.gotoAndStop(10);
}
enemy3_mc.gotoAndPlay(2);
removeEnemyListeners();
removeEventListener(Event.ENTERFRAME, gameLoop);
TweenLite.delayedCall(1.5,loseGameNow);
}
if(!endLevel && brokenBricks)
{
loseGameNow();
}
and this line
TweenLite.delayedCall(1.5,loseGameNow);
calls this function:
private function loseGameNow():void
{
removeEnemyListeners();
gameTimer.stop();
removeEventListener(Event.ENTER_FRAME, gameLoop);
gotoAndStop(“gameOver”);
if(*musicOn)
{
newSong.stop();
mArray0 = new mArray2[URL=“http://www.kongregate.com/forums/4-programming/topics/190167-mobile-flash-app?page=1#fn0”]0();
newSong = mArray0.play(0, 1000);
}
if(enemyTwo)
{
if(*soundOn)
{
array0 = new array2[URL=“http://www.kongregate.com/forums/4-programming/topics/190167-mobile-flash-app?page=1#fn0”]0();
newSound = array0.play(0);
if(!brokenSign) +
{
neonFlicked.stop();
}
}
}
gameOverScore_txt.text = score.toString();
trace(gameOverScore_txt.text + " text");
home_mc.addEventListener(MouseEvent.CLICK, home);
trace(“added home_mc.addEventListener”);
start_mc.addEventListener(MouseEvent.CLICK,preGame);
trace(“added start_mc.addEventListener”);
}
This code works completely fine on my laptop and does not disable the score, or the two buttons until i load it onto my phone, and they become inaccessible causing me to not continue the game.