Welcome to Concentration ("Hello World")

At this time we just want to make sure things are working, so we are only writing some text. It's the first script of our first project, so it's a huge step anyway.

Without closing concentration.fla, create a new file and from New Document window select ActionScript 3.0 Class.

You should be brought to an empty text file. If you are using Flash CS5 you'll get a box asking for the class name. Type in Main, then delete the default script in the text file and start coding:

package {
// importing classes
import flash.display.Sprite;
// end of importing classes
public class Main extends Sprite {
public function Main() {
trace("Welcome to Concentration");
}
}
}

Save the file as Main.as in the same path where you ...

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.