Prev | Current Page 935 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


You ??™ ll get to the latter a little later in the chapter. For now, here ??™ s a look at how one might actually get a
simple SWHX application running.
Following is a simple Neko application utilizing the SWHX library. As the only difference required
within a Flash movie is relative to its communicability with the Neko layer, you don ??™ t need a script for
that just yet:
class App {
static function main() {
swhx.Application.init();
var window = new swhx.Window( ???Sample Application???, 200, 200 );
var server = new neko.net.RemotingServer();
var flash = new swhx.Flash( window, server );
flash.setAttribute( ???src???, ???sample.swf??? );
flash.start();
window.show( true );
swhx.Application.loop();
swhx.Application.cleanup();
}
}
To run this code, you can substitute sample.swf with the location of any SWF file. Bear in mind,
though, that the window that is displayed will show with the dimensions 200 ?— 200 pixels.
Part III: Extending the Possibilities
512
So, this is about as basic as it gets.


Pages:
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947