Skip navigation
yfsjtu
Currently Being Moderated

alchemy DisplayObject

Oct 21, 2009 12:28 AM

AS3_CallS("loadBytes",loader,byteArray);

return  AS3_GetS(loader,"content");

 

always get null in as3!

 

why?

 
Replies
  • Currently Being Moderated
    Oct 22, 2009 7:06 PM   in reply to yfsjtu

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 23, 2009 6:07 AM   in reply to yfsjtu

    No problem! Glad I could help!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points