I want to pass ByteArray from ActionScript to C function.
basically I want do something like this:
void init() __attribute__((used,annotate("as3sig:public function init(byteData: ByteArray):int"),
annotate("as3package:example")));
void init()
{
//here I want to pass byteArray data to C variable.
//similar to AS3_GetScalarFromVar(cVar, asVar)
}
Unforunately I cannot find any function in flascc docs to help me with this.
Example:
The key here is that the heap in C is exposed on the AS3 side as
CModule.ram
, which is aByteArray
object.A pointer malloc'd in C is seen in AS3 as an offset into
CModule.ram
.