AS3_CallS("loadBytes",loader,byteArray);
return AS3_GetS(loader,"content");
always get null in as3!
why?
Hi,
A few comments - maybe some answers.
AS3_CallS("loadBytes", loader, byteArray);
The byteArray variable should be an AS3_Array here. I'm assuming by the variable name, that this is not the case. Create the parameters by using:
AS3_Val loadBytesParam = AS3_Array("AS3ValType", byteArray);
Then pass that reference to the AS3_CallS function:
AS3_CallS("loadBytes", loader, loadBytesParam);
Then don't forget to release the reference:
AS3_Release(loadBytesParam);
return AS3_GetS(loader,"content");
always get null in as3!
why?
I'm pretty sure that loadBytes() is an asynchronous call, in which case, content hasn't been set when the return is made. This is why it would be null.
Thank you very much !
I will try again as you approach.
byteArray is:
AS3_Val flash_utils_namespace = AS3_String("flash.utils");
AS3_Val ByteArray_class = AS3_NSGetS(flash_utils_namespace, "ByteArray");
AS3_Val byteArray = AS3_New(ByteArray_class, AS3_Array(""));
AS3_Release(flash_utils_namespace);
AS3_Release(ByteArray_class);
North America
Europe, Middle East and Africa
Asia Pacific