# AS3 image loading PROBLEM

**URL:** <https://forum.kirupa.com/t/as3-image-loading-problem/305786>\
**Category:** flash\
**Created:** [March 3, 2010, 1:55pm UTC](https://forum.kirupa.com/t/as3-image-loading-problem/305786 "2010-03-03T13:55:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lankyman](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@Lankyman](https://forum.kirupa.com/u/Lankyman)\
**Post date:** [March 3, 2010, 1:55pm UTC](https://forum.kirupa.com/t/as3-image-loading-problem/305786/1 "2010-03-03T13:55:48Z")

</div>

Hi guys I wonder if any of you would be kind enough to help me!?

I’m trying to create a flash movie with external images that load on set keyframes so I can add mask effects to images. I did the tutorial about loading external images. (below is the code) which worked fine for loading in one image on the first keyframe but when i tried the same code on a new keyframe but replacing the image file name the code/file failed.

I can do this using AS2 but not too clued up on AS3 so could anyone point me in the right direction for a tutorial to learn how to do what i’m looking for or even better tell me how to achieve my goals.

[COLOR=DarkRed]var imageLoader:Loader;

function loadImage(url:String):void {

// Set properties on my Loader object  
imageLoader = new Loader();  
imageLoader.load(new URLRequest(url));  
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);  
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

}  
loadImage(“support.jpg”);

function imageLoaded(e:Event):void {

// Load Image  
imageArea.addChild(imageLoader);

}

function imageLoading(e:ProgressEvent):void {[/COLOR]

// Use it to get current download progress  
// Hint: You could tie the values to a preloader 🙂

}

Thanks alot
