Prev | Current Page 69 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

This is because, although the JavaScript file
was executed, the span tag was not yet available to the JavaScript DOM and so the code had nowhere to
place the output.
Figure 2-5
Creating HTML documents for your haXe JavaScript is discussed later in the book.
Program Structure
Now, examine how your program was written in haXe. When writing an application using the haXe
language, you will extend upon the class hierarchies that already exist in the haXe framework. These
classes will eventually form one of two purposes: a runnable program or a code library. Both hierarchical
Chapter 2: Installing and Using haXe and Neko
23
structures are identical in approach, except that a runnable program will expose a static function called
main that will be run when the program is first executed, just as you have in the HelloWorld example:
public static function main()
{
....
}
This is known as the entry point and is responsible for initializing your application and calling the logic
that will facilitate the rest of your program.


Pages:
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81