Prev | Current Page 61 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

The value you set for the
-main switch should be a class name that contains a static method called main . This method is where
you would normally enter all of your initialization code for the entire haXe application.
When compiling your code, other switches can be used that further affect the output created by the
compiler. For example, to change the dimensions of your SWF movie, you could add the following:
-swf-header 400:300:30:0000FF
This would set your movie to 400 pixels wide by 300 pixels high with a speed of 30 frames per second
and a blue background.
You can find a full list of switches for each of the three supported platforms at the end of this chapter.
Though, to help aid you with compiling the examples, .hxml file content is provided throughout the
book where necessary.
Compiling to Neko
To compile your code to the Neko format, open the HelloWorld.hxml file and change the code so that it
looks like the following:
-neko helloworld.n
-main HelloWorld
As you can see, the only changes you made to your .


Pages:
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73