# Issue with URLRequest in an extended class

**URL:** <https://forum.kirupa.com/t/issue-with-urlrequest-in-an-extended-class/318037>\
**Category:** flash\
**Created:** [January 8, 2011, 10:11pm UTC](https://forum.kirupa.com/t/issue-with-urlrequest-in-an-extended-class/318037 "2011-01-08T22:11:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sOuLiEr\_FuReT](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@sOuLiEr\_FuReT](https://forum.kirupa.com/u/sOuLiEr_FuReT)\
**Post date:** [January 8, 2011, 10:11pm UTC](https://forum.kirupa.com/t/issue-with-urlrequest-in-an-extended-class/318037/1 "2011-01-08T22:11:39Z")

</div>

Hello,

I’m new to AS3 and I’m having a problem with an extended class that uses a URLRequest.

I have a basic class called ‘imageLoader’ that I use for loading in external images

```auto
package com.images
{
	import flash.display.*;
	import flash.events.*;
	import flash.net.*;
	
	public class imageLoader
	{
		// ------- Constructor -------
		public function imageLoader(path:String)
		{
			_loaded = false;
			
			_loader = new Loader();
			_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
			
			_loader.load(new URLRequest(path));
		}

		// ------- Properties -------
		public var _loaded:Boolean;

		public var _loader:Loader;

		// ------- Methods -------
		public function imageLoaded(myEvent:Event):void
		{
			_loaded = true;
		}

		public function hasImageLoaded():Boolean
		{
			return _loaded;
		}

		public function destroy():void
		{
			_loader.unload();
		}
	}
}

```

This class is working fine, however I wanted to create a new class extending this one that would eventually store more variables and functions.

```auto

package com.icon
{
	import flash.display.*;
	import flash.events.*;
	import flash.net.*;
	
	import com.images.imageLoader;
	
	public class iconImage extends imageLoader
	{
		// ------- Constructor -------
		public function iconImage(path:String)
		{
			_loaded = false;
			
			_loader = new Loader();
			_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
			
			_loader.load(new URLRequest(path));
		}
	
	}
}

```

Now in my actual flash file when I try to use the new extended class with something like the following;

```auto

var drawIcon:iconImage = new iconImage("test.png");

```

I get the following error;

**Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.**

But using the original class works fine without an error;

```auto

var drawIcon:imageLoader = new imageLoader("test.png");

```

Does anyone have any ideas?
