Tuesday, July 3, 2012

[Action Script] Errors with URLLoader/URLRequest July,2012

Hi, I am trying to import data from a text file and have come across a tutorial on loading data from external documents on the Adobe Help Resource Center for Flex 3.0. I have followed the instructions on their tutorial and oddly when I type the code in one way I get no errors but when typed another, equally valid way, I get errors. I am wondering why this is happening because I find things like this extremely annoyning. ;-)

Here are the two code formats:

This example works fine:
Code: <fx:Script>
        <![CDATA[
var loader:URLLoader = new URLLoader(new URLRequest("params.txt"));
        ]]>
</fx:Script>This code gives the error "1120: Access of undefined property loader"
Code: <fx:Script>
        <![CDATA[                       
                    var request:URLRequest = new URLRequest("params.txt");
                    var loader:URLLoader = new URLLoader();
                    loader.load(request);
                       
        ]]>
</fx:Script>
Errors with URLLoader/URLRequest

Related Post



0 comments: