Is it possible to return a struct from your native code? It’s relatively straight forward to return an int or a boolean but how do you return a more complex struct back to the actionscript?
Is it possible to return a struct from your native code? It’s relatively straight
Share
You can return any object that can be represented in the native code as a FREObject. This actually includes any Actionscript class or Actionscript primitive data type. This includes things like: int, String, Array, BitmapData, ByteArray etc.
For example lets construct a return array of length 4 with the int values 0 – 3:
The method to construct Actionscript classes is a little more complex but follows a similar path. This is ofcourse a native C example, the Java equivalent is somewhat different but still it is possible to return complex objects from the native code.
For more information there is heaps of documentation here:
http://help.adobe.com/en_US/air/extensions/index.html