Function that does not function
I'm terribly frustrated the moment. This script worked until it didn't and I have no clue as what is wrong with it. The parts that doesn't work are the one that in bold. it's a basic condition that look for an item on stage and then go to the function should the item exist. It works fine for a while but then it stop responding to this condition anymore. I traced the object to make sure that it's on stage and it was on stage at the time of the test but still it just refused to go to this function. It should go to function first7Move3(); when yesh7bomb20 is on stage. all other conditions works just fine. Any clue as what's wrong? My sans is that it remembers a deleted code somehow because at one point I had removeChild (yesh7bomb20); in the first7Move3(); function but I had deleted that code . a bug maybe? how to go around it?
if (add7bigGrayBall4.currentFrame == 30) {
if (yesh7bomb17.currentFrame == 91) {
gotoAndPlay(139);
} else if (stage.contains(yesh7bomb20)) {
first7Move3();
} else if (stage.contains(yesh7bomb16)) {
first7Move2();
} else {
first7Move1();
}
} else {
add7bigGrayBall4.gotoAndPlay(1);
}
function first7Move2(): void {
removeChild(yesh7bomb16);
addChild(yesh7bomb17);
yesh7bomb17.x = 321.30;
yesh7bomb17.y = 109.85;
yesh7bomb17.gotoAndPlay(1);
if (stage.contains(yesh7Buket1a)) {
removeChild(yesh7Buket1a);
}
if (stage.contains(yesh7bomb3)) {
removeChild(yesh7bomb3);
}
}
function first7Move1(): void {
addChild(yesh7bomb16);
yesh7bomb16.x = 321.30;
yesh7bomb16.y = 109.85;
yesh7bomb16.gotoAndPlay(1);
if (stage.contains(yesh7Bucket_Cover2)) {
removeChild(yesh7Bucket_Cover2);
}
if (stage.contains(yesh7bomb2)) {
removeChild(yesh7bomb2);
}
if (stage.contains(yesh7gBall16)) {
removeChild(yesh7gBall16);
}
}
function first7Move3(): void {
addChild(yesh7bomb19);
yesh7bomb19.x = 321.30;
yesh7bomb19.y = 109.85;
yesh7bomb19.gotoAndPlay(1);
}
trace(yesh7bomb20);
