13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

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>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Mouse input<br />

The charAt() and indexOf() methods of the String class retrieve the appropriate rows and columns from both the<br />

curr<strong>en</strong>tly clicked button and the previously clicked button. The isLegalContinuation() method returns true if the<br />

row or column is unchanged and if the row or column that has be<strong>en</strong> changed is within a single increm<strong>en</strong>t from the<br />

previous one. If you want to change the rules of the game and allow diagonal spelling, you can remove the checks for<br />

an unchanged row or column and the final line would look like this:<br />

return (Math.abs(prevButtonRow - currButtonRow)

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

Saved successfully!

Ooh no, something went wrong!