Thursday, July 30, 2009

Why doesn't this Flex ActionScript code work?

I'd like to display the HTML from google.com in a text element.





Here is the code I have so far: http://pastebin.com/m6c8215e3





The error I receive is:


TypeError: Error #1009: Cannot access a property or method of a null object reference.


at webService/doSomething()[C:\path...\webS...


at webService/_____webService_button1_click...





If I comment out the line myText.text = myService.lastResult.toString(); then I receive this error:





[RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"]





followed by several other at mx.rpc. errors.

Why doesn't this Flex ActionScript code work?
Ahh I used to get that message all the time in Flash CS3





Basically you need to set an event that triggers *after* your component is loaded...and then after the event try to change the properties


No comments:

Post a Comment