Creating more classes

Do you remember the creation of the Concentration game, when I told you to ignore the alert saying "A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export."?

You can keep ignoring it, but this time you will create the famous "definition for the document class", that is a file like Main.as, with the class relative to board_movieclip.

Delete these two lines from placeBoard function, as we will position board object in its own class.

board.x=105;
board.y=100;

Test the movie and you will see the board aligned with the upper-left corner of the stage. That's ok because you just removed x and y properties.

Without closing connect4.fla, create a new ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.