# XML/AS3 ioerror, URL not found

**URL:** https://forum.kirupa.com/t/xml-as3-ioerror-url-not-found/271274
**Category:** flash
**Created:** [September 20, 2008, 6:29pm UTC](https://forum.kirupa.com/t/xml-as3-ioerror-url-not-found/271274 "2008-09-20T18:29:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ventoline](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@ventoline](https://forum.kirupa.com/u/ventoline)
#### Post date: [September 20, 2008, 6:29pm UTC](https://forum.kirupa.com/t/xml-as3-ioerror-url-not-found/271274/1 "2008-09-20T18:29:10Z")

</div>

Hi,

Probably something very simple but I don’t quite see what !! I have an external xml that looks like this:

```auto
<work>

<piece>
<name cat="GRFX">20's</name>
<url>work/20_1.jpg</url>
<url_big>/work/20s.jpg</url_big>
<url_big>/work/20s_2.jpg</url_big>
<url_big>/work/20s_3.jpg</url_big>
<description>20's a project to recycle the cigarette machines into clothing dispensary object</description>
<link>work/20s/home.html</link>
</piece>
...

```

and a folder “work” inside the folder containing my swf, with the pictures…

```auto

private function onCompleteSmall(e:Event)
		{ 
			e.target.removeEventListener(Event.COMPLETE, onCompleteSmall)
			c =0;
			d=0;
			for (i=0; i > arrayUrl.length; i++)
				{
			thumb = new Bitmap(e.target.content);
			thumb.smoothing = true;
			thumb.x = -thumb.width * .5;
			thumb.y = -thumb.height * .5;
			
			
			var image:MovieClip = new MovieClip();
			image.addChild(thumb);
			
			image.x = 35+ image.width*c;
			image.y = 50+ image.height*d;			
			//imageMC.bigImage = "big.jpg"
			
			//image.addEventListener(MouseEvent.CLICK, onClick);
			//image.addEventListener(MouseEvent.ROLL_OUT, onOut);
			//image.addEventListener(MouseEvent.ROLL_OVER, onOver);
			c++;
			if (c<5){
				c=0;
				d++;}
			gallery.addChild(image);
			}
			addChild(gallery);
		}
		
		private function loadImage(url:String, completeFunction:Function)
		{
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteSmall);
			loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError, false, 0, true); 
			loader.load(new URLRequest( url ));
		}
		
		private function ioError(event:IOErrorEvent){
			trace ("the **** is"+ event);}
		
		public function navig(Event:MouseEvent) {
			//var clickedObject:MovieClip = MovieClip(Event.target);
			trace (Event.target.text);
			var arrayUrl= new Array();
				var arrayName= new Array();
				var arrayUrlBig= new Array();
				var arrayDesc= new Array();
				var arrayLnk= new Array();
				//loadImage(clickedObject.bigImage, onCompleteBig);
			xmlList = xml.work.piece;
			//trace (xmlList);
			for (i=0; i< xmlList.length(); i++){
				if (xmlList*.attribut == Event.target.text)
				a=0;
				var url = new String;
				url = xmlList*.url;
				//trace (url);
				
				arrayUrl.push(url);
				trace (arrayUrl*);
				arrayName.push(xmlList*.name);
				arrayUrlBig.push(xmlList*.url_big);
				arrayDesc.push(xmlList*.description);
				arrayLnk.push(xmlList*.link);
				loadImage(url, onCompleteSmall);
				a++;}
		
		}

```

Thank you.
