A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: TypeError 1034. Possibly a URLRequest/ URLLoader problem.

Threaded View

  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    75

    [RESOLVED] TypeError 1034. Possibly a URLRequest/ URLLoader problem.

    Peek-a-boo, me again. I'm having some trouble with loading in a txt-file and I can't figure out why, as it works in a new .fla file as well. Here's the code in a nutshell:

    PHP Code:
    goldstar.addEventListener(MouseEvent.MOUSE_DOWNshowHS);

    var 
    weekrequest:URLRequest = new URLRequest("weekscores.txt"); 
    var 
    weekloader:URLLoader = new URLLoader();

    //weekloader.dataFormat = URLLoaderDataFormat.VARIABLES;
    //Not sure on this one, reading in data like this is completely new to me.

    weekloader.addEventListener(Event.COMPLETEcheckWeek);

    function 
    showHS(MouseEvent):void{
        
    weekloader.load(weekrequest);  // --> checkWeek
        
    trace("loaded"); //This works
    }

    function 
    checkWeek(event:Event):void{
        var 
    loader2:URLLoader URLLoader(event.target);
            
    //This seems to be the problem.
            
    var variables:URLVariables = new URLVariables(loader2.data);

    This gives me the following error:
    Code:
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@2cdcf191 to flash.net.URLLoader.
    	at Game_fla::MainTimeline/checkWeek()
    	at Game_fla::MainTimeline/launchloop()
    I've also tried several different traces, but they either returned null or nothing, but there's definitely an array of numbers in the .txt file.

    As always, thanks in advance.

    -Patrick
    Last edited by senshi sentou; 01-08-2010 at 05:28 PM.

Tags for this Thread

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