Prev | Current Page 959 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

[class].[method].call( parametersArray );
If you look back closely at the NekoLayer class, there is a line of code that says:
server.addObject( ???App???, NekoLayer );
This line registers the NekoLayer class with the remoting layer as App . Therefore, when you call the class
from the Flash layer, reference the class as App , even though its real physical name is NekoLayer .
(continued)
Chapter 18: Desktop Flash with SWHX
523
You can reference other classes like this, if you like, by making subsequent calls to the addObject
method, so that each of the classes is available to the connection object in the Flash layer. If you don ??™ t
reference a class with this method call, you won ??™ t be able to access its methods from Flash.
Now, what about the calls from Neko to Flash? Well, in the Neko code, two lines are similar to the
connection code specified in the Flash layer, which look like this:
var cnx = swhx.Connection.flashConnect( flash );
cnx.UI.showData.call( [ d ] );
Here, the connection object already knows about the class it is calling from the passed Flash object
parameter to the flashConnect method.


Pages:
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971