[CS3] Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: [CS3] Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Posts
    23

    [CS3] Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

    hi,

    i have a parent swf with images that when clicked loads another swf. the problems is that the child swf is not loading the images that correspond to the scrolling nav neither loads the other swfs. now, when i try the child alond it has no problem loading the images or the swfs.

    the child swf is inside a folder called, "swfIndex"- inside such folder is the child and the folders holding the images and the swf for the child. bellow is the code.

    parent swf load code:
    PHP Code:
    var image1URL:String "swfIndex/" basename1 id1 ".swf"
    var image1Ldr:Loader = new Loader (); 
    var 
    image1URLReq:URLRequest = new URLRequest thumb1URL );

    image1Ldr.load image1URLReq );
    image1Ldr.contentLoaderInfo.addEventListener Event.COMPLETEimage1Loader );

    function 
    image1Loader event:Event ):void
    {
        
    load1Target.addChild image1Ldr.content );    
        var 
    image1Ldr2:Loader = new Loader ();    
    var 
    image1URLReq:URLRequest = new URLRequest thumb1URL );
        
    image1Ldr2.load image1URLReq );
        
    image1Ldr2.contentLoaderInfo.addEventListener Event.COMPLETEimage1Loader2 );

        function 
    image1Loader2 event:Event ):void
        
    {
            
    load1Target2.addChild image1Ldr2.content );    
        }

    child swf load code:
    PHP Code:
    var imageURL:String "images/" basename id ".swf"

    var imageLdr:Loader = new Loader (); 
    var 
    imageURLReq:URLRequest = new URLRequest thumbURL );
    imageLdr.load imageURLReq );
    imageLdr.contentLoaderInfo.addEventListener Event.COMPLETEimageLoader );

    function 
    imageLoader event:Event ):void
    {
        
    loadTarget.addChild imageLdr.content );    

        var 
    imageLdr2:Loader = new Loader (); 
        var 
    imageURLReq:URLRequest = new URLRequest thumbURL );
        
    imageLdr2.load imageURLReq );
        
    imageLdr2.contentLoaderInfo.addEventListener Event.COMPLETEimageLoader2 );

        function 
    imageLoader2 event:Event ):void
        
    {
            
    loadTarget2.addChild imageLdr2.content );    
        }

    Last edited by Lexicon; 04-14-2008 at 06:21 PM.

  2. #2
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    Hi,

    Your code is failing to load the swfs due to an incorrect URL.

    Because you are not listening for the error; you are getting the unhandled event error described in the thread title.

    The URL will be relative to the parent swf, and not relative to the child swf, which is probably why your images are failing to load.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  3. #3
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    thanks for the reply.

    the child swf is loading correctly what isn't loading are the child swf images and the child swf corresponding swf. nowi am not sure what you mean by
    you are not listening for the error
    please explain.

    here is something else i tried on the URL path:
    "var imageURL:String = "Centro_AS3_Index_file/images/" + basename + id + ".swf""

    it didn't do it either if that is what you mean by,
    URL will be relative to the parent swf
    thx again.

    TPOAMBUF,
    Arthemio

  4. #4
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    try...

    PHP Code:
    var imageURL:String "swfIndex/images/" basename id ".swf" 
    ... inside the child swf. Currently the URL you specify is relative to the child swf location, when it should be relative to the parent swf location.

    You might want to add some code such as this to handle any load errors, so you don't get the 2035 error...

    PHP Code:
    imageLdr2.addEventListener(IOErrorEvent.IO_ERRORioErrorHandler);

    function 
    ioErrorHandler(event:IOErrorEvent):void
    {
        
    trace("ioErrorHandler: " event);

    http://livedocs.adobe.com/flash/9.0/...#event:ioError
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  5. #5
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    for some reason it is still not working. i am pulling my hair by now. i tink i should go to sleep and get up early in the mornin' to look at it some more. i can't figure it out.

    let me know if you tink of anything else. thx.
    Arthemio

  6. #6
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    look at this. do you think that "basename" should be equal to "root.basename" or "parent.parent.basename"

    PHP Code:
    var id:Number;
    var 
    basename:String;

    //trace ( id );
    idTag.text id;
    idTag.visible false;

    basename root.root.basename// another way is parent.parent.basename

    // loads the thumbnail images
    var thumbURL:String "swfIndex/thumbs/" basename id ".jpg"// this is the name of the folder that contains jpg
    var imageURL:String "swfIndex/images/" basename id ".swf"// this is the name of the folder that will contain the .swfs

    var imageLdr:Loader = new Loader (); // this is what is going to load the .swf files - OJO - 
    var imageURLReq:URLRequest = new URLRequest thumbURL );
    imageLdr.load imageURLReq );
    imageLdr.contentLoaderInfo.addEventListener Event.COMPLETEimageLoader );

    function 
    imageLoader event:Event ):void
    {
        
    loadTarget.addChild imageLdr.content );    
    // repeating generally the same code for the mirror effect
        
    var imageLdr2:Loader = new Loader (); // this is what is going to load the .swf files - OJO - 
        
    var imageURLReq:URLRequest = new URLRequest thumbURL );
        
    imageLdr2.load imageURLReq );
        
    imageLdr2.contentLoaderInfo.addEventListener Event.COMPLETEimageLoader2 );

        function 
    imageLoader2 event:Event ):void
        
    {
            
    loadTarget2.addChild imageLdr2.content );    
        }
        
        
    imageLdr2.addEventListener(IOErrorEvent.IO_ERRORioErrorHandler); 

        function 
    ioErrorHandler(event:IOErrorEvent):void 
        

                
    trace("ioErrorHandler: " event); 
        } 

    Last edited by Lexicon; 04-15-2008 at 04:47 AM.

  7. #7
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    I didn't realise you were trying to grab basename from the parent swf.

    You will not be able to access the parent's variable like that.

    To access the parent swf's variable you will need to first recast the parent to a MovieClip.

    e.g.

    PHP Code:
    traceMovieClip(parent).basename ); 
    Now this itself will only work once the loader.content has been added to the stage.. i.e. (not gonna work on the first frame of the child swf because this code will run before the loader COMPLETE function is run, which adds the swf to the stage).


    Another solution might be to fire off an init function etc. once the child swf is loaded, then you can pass the required basename var.


    On a sidenote you should use PHP or CODE tags to display your code.
    http://board.flashkit.com/board/showthread.php?t=584396
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  8. #8
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    Moved to Actionscript 3 forum.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  9. #9
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    hi Lexicon,
    the code you saw is within the movieclip linkage which is in the library. so,
    actually i am trying to grab basename from its parent -

    here is the sample code on at root level of the swf where i define basename - "p1-" being the base name for the external images and swfs to load:
    PHP Code:
    var id:Number;
    var  
    n:Number 21//number of thumbnails to load or create
    var  a:Number 0// wild loop
    var thumbsize 100// 101 will create a thin piece of line in between
    var basename:String "p1-";
    var 
    speed:Number = -11;
    var 
    touchingBar:Boolean false
    i also tried using on the link path
    PHP Code:
    var imageURL:String "parentSWF/images/" basename id ".swf" 
    and still the images are not loading never mind the error message.

    i will show this work to my client in two hours and... i am fried. just fried.

    thank you for the side note. i will keep in mind the rules.

    Arthemio

  10. #10
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    Moved to Actionscript 3 forum.
    what do you mean. i don't get it (??)

    Arthemio

  11. #11
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    You want to attach some source files for me? I'm getting a little confused about how you have set this project up.

    ( I moved your thread from the Actionscript Forum to the Actionscript 3 forum )
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  12. #12
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    attached are the files. my apologies for confusing you... i am confused myself.

    let me know if you ever figure it out and thx for the hints.

    Arthemio
    Attached Files Attached Files

  13. #13
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    your file seems to actually work if you put the images in the right place....

    I have the thumbs working without doing anything but adding correctly named image files into a thumbsIndex folder.
    Same with the swf files in the swfIndex folder.

    Could it be your system has a problem with the "-" in the file names?
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  14. #14
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    Had another look. Realising that I didn't try it properly using the p-2.fla you supplied.

    Looks like an oldschool library confict with the thumb_template linkage identifier "thumb".

    It begins to work if you change the linkage to thumb_template in p02.fla to be something different than the similar object in the other fla.

    I actually thought such an issue would not occur in AS3 but it seems it does still happen.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  15. #15
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    i see what you mean with the linkage name. i am changing that name by adding a p2 to it. so now it will read: "thumb_templatep2"- however, the linkage class is still the same "thumb" - are you able to see the thumb images when you load the child swf onto the parent swf?

    are you using this path in the child .fla (p-2) to load the images and swfs
    "var imageURL:String = "swfIndex/images/" + basename + id + ".swf""

    i am playing with it- have to run to my meeting and show my none working proyect....

    i will continue working on this afterwork.

    Arthemio
    thx

  16. #16
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    good luck!

    Change the actual linkageID to something other than "thumb", I got somewhere by changing it to "thumb2".

    Without that ID change I noticed that the child swf actually attaches the parent's version of "thumb".
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  17. #17
    Junior Member
    Join Date
    Jun 2007
    Posts
    23
    Lexicon. it works! it works!
    i went to the meeting with broken swf ready to tell the client that the work is still in progress and not yet ready. the client was late and i ran back to my office to check the forum- you had the last suggestion on the linkage name which i did change it and it worked. i ran back to the conference room and was able to present the working prototyte of the project.

    mil gracias Lexicon

    the client asked for a lot of changes and addition of elements like text to explain each of the panels (panels are the 8 vertical images on the parent swf). now when users click on the any of the images the loaded child will have a description of what the panel is about then when click on scrolling horizontal images the txt will go away and the corresponding img will come up.

    will continue posting in this thread if that is ok with you.

    thx.
    Arthemio

  18. #18
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    no worries, glad to be of some help.

    Is a tricky one to spot if you haven't seen it happen before.

    I remember tearing my hair out over the same issue on a massive project several years ago. I nearly cried

    Luckily my hair grew back.

    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  19. #19
    Mafia Bros
    Join Date
    Nov 2007
    Location
    Czech, Moravia
    Posts
    33
    Hello guys
    I am pulling my hair already couple of hours and trying lots things but still this unwanted message when clicking the thumbs and imgs are not changing and none error codes. Can you please someone take a look?
    I even tried to change linkages...still same.

    Code:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.MouseEvent;
    import flash.geom.Rectangle;
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;
    
    var xmlFile:XML;
    
    var xmlLoader:URLLoader = new URLLoader(new URLRequest("gallery.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, onCompleteXmlLoad);
    
    var xcoord:int = 10;
    var gal:gallery = new gallery ();
    gal.x = 10;
    gal.y = 10;
    addChild(gal);
    
    function onCompleteXmlLoad(e:Event):void
    {
    
    	xmlFile = new XML(xmlLoader.data);
    
    	//trace(xmlFile.photo.url);
    	var gal:gallery = new gallery ();
    	gal.x = 10;
    	gal.y = 10;
    	addChild(gal);
    
    	var len:int = xmlFile.photo.length();
    	trace(len);
    
    	for (var i:int=0; i<len; i++)
    	{
    		var t:thumbs2 = new thumbs2 ();
    		t.x = xcoord;
    		t.y = 320;
    		t.buttonMode = true;
    		t.name = (i + 1).toString();
    		addChild(t);
    
    		t.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
    		t.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
    		t.stage.addEventListener(MouseEvent.CLICK, onMouseClick);
    
    
    		var loaderThumb:Loader = new Loader();
    		loaderThumb.load(new URLRequest("thumbs/" + (i+1) + ".jpg"));
    		t.addChild(loaderThumb);
    
    		xcoord +=  t.width + 10;
    	}
    	var loader:Loader = new Loader();
    	loader.load(new URLRequest("imgs/1.jpg"));
    	gal.addChild(loader);
    
    }
    
    function onMouseOver(e:MouseEvent):void
    {
    	e.currentTarget.alpha = 0.5;
    }
    
    function onMouseOut(e:MouseEvent):void
    {
    	e.currentTarget.alpha = 1;
    }
    
    function onMouseClick(e:MouseEvent):void
    {
    	var loader:Loader = new Loader();
    	loader.load(new URLRequest("imgs/" + e.currentTarget.name + ".jpg"));
    	loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    
    	gal.addChild(loader);
    }
    
    //with this it still doesn't work
    function ioErrorHandler(event:IOErrorEvent):void
    {
    	trace("ioErrorHandler: " + event);
    }
    "I believe in peace and bashing two bricks together."
    .~*MONTY PYTHON*~.*~.

    .~*MONGOL RALLY 2009*~. PIRANHA BROTHERS RT

  20. #20
    Mafia Bros
    Join Date
    Nov 2007
    Location
    Czech, Moravia
    Posts
    33
    here is the link to files:
    http://suziklinik.cz/flashKit/
    thanks ;-)
    "I believe in peace and bashing two bricks together."
    .~*MONTY PYTHON*~.*~.

    .~*MONGOL RALLY 2009*~. PIRANHA BROTHERS RT

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

Poll by Flashkit.com