[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 );
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?
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?
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
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.COMPLETE, imageLoader );
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.COMPLETE, imageLoader2 );
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:
trace( MovieClip(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.
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?
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?
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.
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?
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?
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?
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....
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?
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.
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?
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*~.*~.