How to reload/reset the scene?


This code is an attempt to restore the original setup scene however it would only remove all the scene and leave empty, it will not load the elements once again. what I'm missing here?


playLvlAgn.addEventListener (MouseEvent.CLICK, doLevelAgain);

function doLevelAgain(event: MouseEvent): void {}

stage.removeChildren ();

gotoAndPlay (1);

}

OK, I found the solution. all the removeChild s should be inside the function of the button. I had also sent frame2 and stop just in case someone tried to reload the game even before he began to play.

playLvlAgn.addEventListener (MouseEvent.CLICK, doLevelAgain);

function doLevelAgain(event: MouseEvent): void {}

gotoAndStop (2);

for (var i: int = 0; i)< 3;="" i++)="">

If (balls.length > 0) {}

Prom = balls.pop ();

ball.parent.removeChild (ball);

trace("If--0c")

}

}

If (stage.contains (playLvlAgn)) {}

removeChild (playLvlAgn);

trace ("If - 1")

}

If (stage.contains (yesh8DoorA)) {}

removeChild (yesh8DoorA);

trace ("If - 2")

}

If (stage.contains (yesh8DoorB)) {}

removeChild (yesh8DoorB);

trace ("If - 3")

}

If (stage.contains (yesh8DoorC)) {}

removeChild (yesh8DoorC);

trace ("If - 4")

}

If (stage.contains (yesh8allBuckets1)) {}

removeChild (yesh8allBuckets1);

trace ("If - 5")

}

If (stage.contains (yesh8allBuckets2)) {}

removeChild (yesh8allBuckets2);

trace ("If - 6")

}

If (stage.contains (add8bigGrayBall6)) {}

removeChild (add8bigGrayBall6);

trace ("if - 7")

}

If (stage.contains (yesh8wall5)) {}

removeChild (yesh8wall5);

trace ("If - 8")

}

If (stage.contains (yesh8step)) {}

removeChild (yesh8step);

trace ("If - 9")

}

If (stage.contains (yesh8bomb26)) {}

removeChild (yesh8bomb26);

trace ("If - 10")

}

If (stage.contains (yesh8bomb27)) {}

removeChild (yesh8bomb27);

trace ("If - 10")

}

If (stage.contains (yesh8bomb28)) {}

removeChild (yesh8bomb28);

trace ("If - 10")

}

If (stage.contains (yesh8bomb2)) {}

removeChild (yesh8bomb2);

trace ("If - 11")

}

If (stage.contains (yesh8bomb3)) {}

removeChild (yesh8bomb3);

trace ("If - 12")

}

If (stage.contains (yesh8gBall21)) {}

removeChild (yesh8gBall21);

trace ("If - 13")

}

If (stage.contains (yesh8gBall24)) {}

removeChild (yesh8gBall24);

trace ("If - 14")

}

If (stage.contains (yesh8redHalfSwing)) {}

removeChild (yesh8redHalfSwing);

trace ("If - 15")

}

gotoAndPlay (1);

}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • Is satellite P870 - card WLAN 802.11n 5 GHz?

    I just bought a 2870 B DSL modem router wireless that supports the 2.4 and 5.0 Ghz.I set up both a 2.4 and 5.0 wireless systems, the old Toshiba P870 of one month running W7 (64-bit) can see and connect to the 2.4 Ghz network but can not see the 5.0

  • Update Setup interruption

    CONF. Update seems to happen just in the middle of something and shuts down the computer! I know there are indications that it is about to take place, but do not always notice the prompt. Is there a noise like a beep or something that I can engage on

  • SP2 Installation problems

    I have difficulties to obtain Service Pack 2 for x 64 Vista install. I tried to install SP2 previously but my computer has been damaged somewhere in the process and would not start windows. I used the Windows installation disk to repair Windows and s

  • resizing the window active to see bottom of page

    I chose the wreck more than the monitor recommends, and have updated the drivers for the graphics card and monitor. I played with the "active title bar" without any solution to this problem, I can not hide my taskbar using the up/down arrows with my

  • HP Pro 3500 format microtour PC driver - graphics ((xp))

    Hello guysI bought a HP 3500 M TBut because of my work and programs need to use XP Service Pak 3But I'm having a problem with the definition of the screen never before loading and experience you do I do to download a file driver - graphics for Window