# Getting a Dynamic Moviclip Width

**URL:** https://forum.kirupa.com/t/getting-a-dynamic-moviclip-width/259264
**Category:** flash
**Created:** [May 2, 2008, 4:27pm UTC](https://forum.kirupa.com/t/getting-a-dynamic-moviclip-width/259264 "2008-05-02T16:27:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![switchBack](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@switchBack](https://forum.kirupa.com/u/switchBack)
#### Post date: [May 2, 2008, 4:27pm UTC](https://forum.kirupa.com/t/getting-a-dynamic-moviclip-width/259264/1 "2008-05-02T16:27:25Z")

</div>

Hey everyone. I’m running into a little snag with this project I’m working on, and need higher powers to help me work it out.

I’m loading in external images through XML, and am trying to get the width of these images after they load, so that I can place them end to end, using the width as the spacing.

Here is what I have so far:

```auto
for(i=0; i<main.length; i++){
        var loadImageListener:Object = new Object();
        var imageLoader = _root.createEmptyMovieClip("loader"+i, this.getNextHighestDepth());
        
        imageLoader.addListener(loadImageListener);        
        imageLoader.loadMovie(main*.attributes.url);
        loadImageListener.onLoadInit = function(){
            trace(["loader"+i]._width);
        };        
        imageLoader._y = 225;
        imageLoader._x = this["loader"+(i-1)]._x + 490;        
    };

```

Any help would be very much appreciated. If you notice in the last line of code I’m using the number 490. I’m wanting to replace that with the width so that the pictures can be any width and they will still line up end to end.

Thanks for all your help.
