Resetting the game


show more Resetting the game provides you with in-depth training on Developer. Taught by Todd Perkins as part of the ActionScript 3.0 in Flash Professional CS5 Essential Training show less
please wait ...

Resetting the game

After someone is finished with the game, they may want to play again. Let's take a look at how to do that. So let's scroll down and find the winGame method. Now if you're ever looking at these methods in here, because we're going to have to tab in so much to organize the code, if the word wrap bothers you, then you can always turn it off. But if you still want it on anyway, but you want more space, you can always just click these Minimize buttons to minimize the panels, and double-click the Timeline to get a little bit more space.

So here, right below win.removeEventListener, I'm going to add win.addEventListener, capital E, capital L. This is going to be for a mouse click, and this is how we're going to reset the game. So we'll type MouseEvent capital M, capital E, .CLICK, in all caps, then a comma and space, and then clickWin capital W. So we'll have to define that method now. Right below the winGame method, make sure you're doing it below the right ...

Resetting the game
Video duration: 8m 24s 7h 8m Beginner Updated May 23, 2012

Viewers:

Resetting the game provides you with in-depth training on Developer. Taught by Todd Perkins as part of the ActionScript 3.0 in Flash Professional CS5 Essential Training

please wait ...