02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> <strong>Games</strong><br />

that is incremented by one as each run through the loop is executed. The other thing <strong>to</strong> point out<br />

is that the first movie clip already exists so if count is equal <strong>to</strong> zero then the clip does not need<br />

duplicating. Having created this function we need <strong>to</strong> be sure it does the job for which it is intended.<br />

By running the movie using ‘Ctrl + Enter’ you should see the entire board displayed. But it would<br />

be useful <strong>to</strong> set up a connection between the game board array and the duplicated movie clips. For<br />

this purpose why not create a function called something like ‘testGameBoardArray’. The purpose<br />

of the function is <strong>to</strong> populate the array and then <strong>to</strong> call the function ‘updateGameBoard’. So the<br />

test function is dual purpose: it will check the ‘initBoard’ function and the ‘updateGameBoard’<br />

function. The function will look something like this:<br />

function testGameBoardArray(){<br />

for (row=0; row

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!