A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Can't figure out this error: Error #2044: Unhandled ioError:. text=Error #2035: URL N

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    2

    Can't figure out this error: Error #2044: Unhandled ioError:. text=Error #2035: URL N

    I have been following the Flash CS3 Portfolio website tutorial on Lynda.com exactly and haven't run into any problems until this one. Can anyone help me decipher why I am getting this error?


    Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found. URL: file:///C|/Users/jennifer.donnelly/Desktop/DRENNANPROJECTSNEW/porfolio/large/courand_LG.jpg
    Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found. URL: file:///C|/Users/jennifer.donnelly/Desktop/DRENNANPROJECTSNEW/porfolio/large/brisendine_LG.jpg


    ActionScript:


    //Load the thumbnails
    var thumbLoader:Loader = new Loader();
    thumbLoader.load(new URLRequest("portfolio/thumbs/courand1.jpg"));
    thumbLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, thumbLoaded);
    function thumbLoaded(event:Event):void {
    //add the thumbnail to the allThumbnail instance
    allThumbnails.addChild(thumbLoader);
    thumbLoader.addEventListener(MouseEvent.CLICK, loadMainImage1);
    function loadMainImage1(event:MouseEvent):void {
    largeUILoader.source="porfolio/large/courand_LG.jpg";
    }

    }

    var thumbLoader2:Loader = new Loader();
    thumbLoader2.load(new URLRequest("portfolio/thumbs/brisendine1.jpg"));
    thumbLoader2.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded2);
    function thumbLoaded2(event:Event):void {
    //add the thumbnail to the allThumbnail instance
    allThumbnails.addChild(thumbLoader2);
    thumbLoader2.x=70;
    thumbLoader2.addEventListener(MouseEvent.CLICK, loadMainImage2);
    function loadMainImage2(event:MouseEvent):void {
    largeUILoader.source="porfolio/large/brisendine_LG.jpg";
    }

    }

    var thumbLoader3:Loader = new Loader();
    thumbLoader3.load(new URLRequest("portfolio/thumbs/beehouse1.jpg"));
    thumbLoader3.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded3);
    function thumbLoaded3(event:Event):void {
    //add the thumbnail to the allThumbnail instance
    allThumbnails.addChild(thumbLoader3);
    thumbLoader3.x=140;

    }

    var thumbLoader4:Loader = new Loader();
    thumbLoader4.load(new URLRequest("portfolio/thumbs/fleming1.jpg"));
    thumbLoader4.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded4);
    function thumbLoaded4(event:Event):void {
    //add the thumbnail to the allThumbnail instance
    allThumbnails.addChild(thumbLoader4);
    thumbLoader4.x=210;

    }



    Thank you for your help!!!

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    Well, I guess the reason is that you added event listeners to loader objects themselves.
    For example the first block of code:
    Actionscript Code:
    thumbLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, thumbLoaded);
    function thumbLoaded(event:Event):void {
    //add the thumbnail to the allThumbnail instance
    allThumbnails.addChild(thumbLoader);
    thumbLoader.addEventListener(MouseEvent.CLICK, loadMainImage1);
    Firstly you used the correct construction:
    thumbLoader.contentLoaderInfo.addEventListener
    But then you add listener to the same loader object, and I can't get why?
    thumbLoader.addEventListener(MouseEvent.CLICK, loadMainImage1);
    The way to solve this problem is to create a variable to keep the loader content like this:

    Actionscript Code:
    var thumbnail = thumbLoader.content;

    then add this variable ass a child here:
    Actionscript Code:
    allThumbnails.addChild(thumbnail);

    And then add listeners for mouse clicks to this variable:

    Actionscript Code:
    thumbnail.addEventListener(MouseEvent.CLICK, loadMainImage1);
    Last edited by caseyryan; 07-10-2010 at 01:23 AM.

  3. #3
    Member
    Join Date
    Jan 2008
    Posts
    55
    I´m having the same problem too

    I guess the problem is that i have 4 movieclips inside two other movieclips and i´m not calling them correctly.

    Here´s the code:

    Code:
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    
    
    var Xpos:Number = -400;
    var Ypos:Number = -300;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    
    var defaultSWF:URLRequest = new URLRequest("swfs/Texto.swf");
    
    loader.load(defaultSWF);
    loader.x=Xpos;
    loader.y=Ypos;
    con2.cont3.addChild(loader);
    
    
    //Bts Univ function
    function btnClick(event:MouseEvent):void {
    con2.cont3.removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/"+event.target.name +".swf");
    loader.load(newSWFRequest);
    loader.x=Xpos;
    loader.y=Ypos;
    con2.cont3.addChild(loader);
    }
    
    con2.cont3.menu1.addEventListener(MouseEvent.CLICK,btnClick);
    con2.cont3.menu2.addEventListener(MouseEvent.CLICK,btnClick);
    con2.cont3.menu3.addEventListener(MouseEvent.CLICK,btnClick);
    con2.cont3.menu4.addEventListener(MouseEvent.CLICK,btnClick);
    I´m trying to press menu1...menu2 and menu4. The menu movieclips are inside the cont3 movieclip who is inside the con2 movieclip.

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    You can't add Loader object to the display list itself as you're trying to do here:
    Actionscript Code:
    con2.cont3.addChild(loader);

    Normally, the construction like this is used:
    Actionscript Code:
    con2.cont3.addChild(loader.content);

    But the better way, is to assign loader.content to a variable, and then add the variable as a child.

  5. #5
    Member
    Join Date
    Jan 2008
    Posts
    55
    caseyryan thanks fro your help.

    I added the content part to my code but go an error 2025: The supplied DisplayObject must be a child of the caller.

    How do i assign the loader.content to a variable?
    I´m very new to flash some things i still don´t know how to get there.

  6. #6
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    mm.. Have you also added the same to the "removeChild" method?
    Actionscript Code:
    con2.cont3.removeChild(loader.content);

    How do i assign the loader.content to a variable?
    I do it this way:

    var someStuff:* = loader.content;

    in case i'm not sure what the content is. But if I know exactly what it's supposed to be, I use this sort of construction: e.g. it's Bitmap
    Actionscript Code:
    var image:Bitmap = Bitmap(loader.content);

  7. #7
    Member
    Join Date
    Jan 2008
    Posts
    55
    Now i´m getting an error 1006 value is not a function.

    I used this:

    Code:
    var con2 = con2(loader.content);
    con2 being the main movieclip. I think the problem here is to figure out how to press a moveiclip that is on the last level to show up on the 1st level but without dissapearing from the stage.

    For example i have menu1 inside the cont3 movieclip which is inside the con2 movieclip to call an external swf but the swf shows up below the Menu button. This Menu button is also isnide the con2 movieclip.

    I´ve tried to load the swf`s to an empty movieclip on the stage but i was getting alot of errors. Maybe that´s the better solution for me?

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