Prev | Current Page 953 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Application.init();
var window = new swhx.Window(
???Test Application???,
200,
200,
swhx.Window.WF_TRANSPARENT );
var flash = new swhx.Flash( window, null );
flash.setAttribute( ???src???, ???ui.swf??? );
flash.onFSCommand = function( p1 : String, p2 : String )
{
switch ( p1 )
{
case ???moveLeftRight???:
window.left = Std.parseInt( p2 );
case ???moveUpDown???:
window.top = Std.parseInt( p2 );
}
return null;
}
flash.start();
window.show( true );
swhx.Application.loop();
swhx.Application.cleanup();
}
}
Compile this code for Neko as app.n .
Part III: Extending the Possibilities
520
If you now run the Neko application, you should see a small red square perform a figure - eight dance in
the top left corner of your monitor. Neat, huh? All that ??™ s really happening is that a sequence of values
alternate from ??’ 20 to 20 for the vertical position and from ??’ 10 to 10 for the horizontal. The values are
then consistently passed to Neko through the FSCommand calls, and the window position is updated
accordingly.


Pages:
941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965