A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Error 1046 URLLoader

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    4

    Error 1046 URLLoader

    i have this code in my main program at the begining
    and it produces the errors below but it works in isolation what can the problem be?

    code

    var myTextLoader:URLLoader = new URLLoader ();
    myTextLoader.addEventListener(Event.COMPLETE, onLoaded);

    function onLoaded(e:Event):void {
    trace(e.target.data);
    }

    myTextLoader.load(new URLRequest("mytxt.txt"));

    Errors

    1046: Type was not found or was not a compile-time constant: URLLoader.
    1180: Call to a possibly undefined method URLLoader.
    1180: Call to a possibly undefined method URLRequest.
    thnaks andrew

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You need to import flash.net.URLLoader and flash.net.URLRequest

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center