# Passing contentLoaderInfo back to use

**URL:** <https://forum.kirupa.com/t/passing-contentloaderinfo-back-to-use/266575>\
**Category:** Uncategorized\
**Created:** [July 22, 2008, 10:59am UTC](https://forum.kirupa.com/t/passing-contentloaderinfo-back-to-use/266575 "2008-07-22T10:59:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![partimer](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@partimer](https://forum.kirupa.com/u/partimer)\
**Post date:** [July 22, 2008, 10:59am UTC](https://forum.kirupa.com/t/passing-contentloaderinfo-back-to-use/266575/1 "2008-07-22T10:59:36Z")

</div>

I’ve the following code that loads a list of thumbnail jpgs - I need to get the width of each loaded item so as to centre them vertically within another object but I can’t get the image attributes until the image is loaded.

I’ve added a COMPLETE listener - which traces the widths fine - am I right in thinking that I can’t use a ‘return’ within an event listener?

If not, how can I get to the various jpg widths in order to use them?

Many thanks in advance,

Pt

```auto
 
 function ImageLoad(u:String,Ypos,Xpos){
   var positionY = Ypos;
   var positionX = Xpos;
   var loader:Loader = new Loader();
   var request:URLRequest = new URLRequest(u);
   loader.load(request);
   loader.name = u;
   scrollBox1.content.scaleX=1;
   scrollBox1.content.addChild(loader);
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
   }
 
 function loaded(event:Event):void {
  trace(event.target.loader.contentLoaderInfo.width);
  // the above line traces the widths fine - but how do I pass these back to the original ImageLoad function to use the values?
 }

```
