# Variable for Loader Content

**URL:** <https://forum.kirupa.com/t/variable-for-loader-content/278948>\
**Category:** flash\
**Created:** [January 7, 2009, 10:50pm UTC](https://forum.kirupa.com/t/variable-for-loader-content/278948 "2009-01-07T22:50:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paradise\_Wolf](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@Paradise\_Wolf](https://forum.kirupa.com/u/Paradise_Wolf)\
**Post date:** [January 7, 2009, 10:50pm UTC](https://forum.kirupa.com/t/variable-for-loader-content/278948/1 "2009-01-07T22:50:29Z")

</div>

[FONT=“Arial”]Is it possible to create a variable that references a loader content ?

For instance, in the example below, is it possible of having something like:

[COLOR=“Blue”]var LoaderContent:SOMETYPE = new SOMETYPE();

LoaderContent = pictLdr.content;[/COLOR]

\*\*And then using LoaderContent variable instead ?

What type of variable should it be ?\*\*

[COLOR=“Blue”]var container:Sprite = new Sprite();  
addChild(container);[SIZE=“4”][/SIZE]  
var pictLdr:Loader = new Loader();  
var pictURL:String = “banana.jpg”  
var pictURLReq:URLRequest = new URLRequest(pictURL); pictLdr.load(pictURLReq);

pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);

function imgLoaded(event:Event):void  
{  
container.addChild(pictLdr.content);  
}[/COLOR]  
[/FONT]
