# External Image loading

**URL:** <https://forum.kirupa.com/t/external-image-loading/230202>\
**Category:** flash\
**Created:** [June 23, 2007, 10:31pm UTC](https://forum.kirupa.com/t/external-image-loading/230202 "2007-06-23T22:31:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lonerhino](https://avatars.discourse-cdn.com/v4/letter/l/45deac/32.png) [@lonerhino](https://forum.kirupa.com/u/lonerhino)\
**Post date:** [June 23, 2007, 10:31pm UTC](https://forum.kirupa.com/t/external-image-loading/230202/1 "2007-06-23T22:31:17Z")

</div>

I’m looking to load random backgroud jpg’s into a Flash movie upon load. These images will just sit there looking pretty. Ultimately, I will likely have an additional image with a higher “depth” that I will set a blend mode on – blending with the stationary background images.

My questions:

[LIST=1]  
[_]Is a loader instance the best “container” for this approach?  
[_]Would using a Sprite be a better practice & why?  
[_]Commonplace to put loader instances inside(as children) of sprites? – beneficial here?  
[_]Anything wrong with sending various images to the same loader instance or is that the logical solution?  
[/LIST]

Thanks

working test so far

```php
//constructors
var imgLoader:Loader = new Loader();
var sRequest:URLRequest = new URLRequest("images/bg/plants.jpg");

//event handle
imgLoader.addEventListener(Event.COMPLETE, onComplete);
imgLoader.load(sRequest);
addChild(imgLoader);

function onComplete(evtObj:Event):void{
	
	trace("loaded");
	
}

//----------------------------------------------------
//test button to verify multiple images go into single loader
var spr:Sprite = new Sprite();
spr.graphics.beginFill(0xFF0000, 1);
spr.graphics.drawRect(0,0, 100, 22);
spr.graphics.endFill();

var btn:SimpleButton = new SimpleButton();
btn.upState = spr;
btn.overState = spr;
btn.downState = spr;
btn.hitTestState = spr;
btn.useHandCursor = true;
btn.x = 20;
btn.y = 20;
btn.addEventListener(MouseEvent.CLICK, clickHandler);
addChild(btn);

function clickHandler(event:MouseEvent):void {
     
	 imgLoader.load(new URLRequest("images/bg/tulips.jpg"));
	 
}

```
