Bernd Kischnick
2009-May-19 14:25 UTC
[Swfdec] How to create "real" LocalConnection objects?
Hello list! I'm trying to implement some functionality for the ActionScript class LocalConnection in swfdec. The library currently provides stub implementations for LocalConnection.connect(), .send() etc. My implementation for LocalConnection.send() works alright. But now I that I'm trying to get LocalConnection.connect() running, I've stumbled over the fact that the existing stub implementations don't seem to provide a "real" ActionScript object. They seem to work more like class level functions (which is quite okay for a stub, I guess). I'm having trouble to replace the stub implementations with code that creates an actual object. I've tried to adapt the existing implementation of NetConnection. But my object constructor is not called when the Flash Movie says "new LocalConnection()". The methods are still called, but without LocalConnection object. I suspect that there's some magic hidden in the SWFDEC_AS_NATIVE () macros. I've decorated my constructor function with this macro invocation: SWFDEC_AS_CONSTRUCTOR (2200, 200, swfdec_local_connection_construct, swfdec_local_connection_get_type) which is adapted from the NetConnection implementation. But I'm a bit clueless about the numbers in the macro. Thanks in advance for any hints! - Bernd -- - Bernd Kischnick