Prev | Current Page 955 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

SWHX for desktop
applications can use the same remoting infrastructure, combined with a few simple proxy functions that
make calling from one layer to the next incredibly simple indeed. This leaves the developer with the job
of creating solid functionality, not the difficult job of creating clean code. Well, at least, not more
than usual.
Here ??™ s a look at an example. Create a new document and enter the following:
class NekoLayer
{
public static function main()
{
var inst = new NekoLayer();
}
public function new()
{
swhx.Application.init();
var window = new swhx.Window( ???Test Application???, 400, 300 );
var server = new neko.net.RemotingServer();
server.addObject( ???App???, NekoLayer );
var flash = new swhx.Flash( window, server );
flash.setAttribute( ???src???, ???ui.swf??? );
flash.start();
window.onRightClick = function()
{
var cnx = swhx.Connection.flashConnect( flash );
var d = readData( ???test.txt??? );
cnx.UI.showData.call( [ d ] );
return false;
}
Chapter 18: Desktop Flash with SWHX
521
window.


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