I have a game in which a flight will shoot bullets and when the bullet hits an enemy ship a blast effect comes and another frame loads. Now the problem i'm facing with is the blast effect and the next frame are loading at a time. So, I've added this script:
if (this.hitTest(_root["enemy1"])) {
this.removeMovieClip();
_root.enemy1._x=2000;
_root.option1._x=2000;
addExplosion(800, 200, explosionParticleAmount, explosionDistance, explosionSize, explosionAlpha);
this._x=-900000;
var sound:Sound = new Sound(this);
sound.attachSound("explode");
sound.start();
flag = true;
wait();
checkAnswer(_root.option1.text);
}
function wait() {
stop();
var myInterval = setInterval(function () {
play();
clearInterval(myInterval);
}, 5*1000); // stop for 5 seconds
}
function checkAnswer(answer){
if(questions[level][1] == answer){
status_flag=true;
score=score+10;
bullet_fire=false;
gotoAndStop(3);
}else{
bullet_fire=false;
gotoAndStop("Scene 2",1);
}
}
But still the result is same. I also tried increasing the time, but i am still unable to stop that another frame from pausing. Please help me out. Thank you