# \[external asset\] can't get width/height

**URL:** <https://forum.kirupa.com/t/external-asset-cant-get-width-height/272454>\
**Category:** flash\
**Created:** [October 5, 2008, 2:32pm UTC](https://forum.kirupa.com/t/external-asset-cant-get-width-height/272454 "2008-10-05T14:32:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stratboy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/stratboy/32/3054_2.png) [@Stratboy](https://forum.kirupa.com/u/Stratboy)\
**Post date:** [October 5, 2008, 2:32pm UTC](https://forum.kirupa.com/t/external-asset-cant-get-width-height/272454/1 "2008-10-05T14:32:45Z")

</div>

Hi!

I’ve got a class, FileLoader, that loads swf. It dispatch an Event.COMPLETE.  
There’s a listener on Event.COMPLETE that add the swf to an empty movieclip called page.  
Immediately after adding the swf to page, page dimensions still are == 0. Why?  
If for ex. I then resize the window, I can retrieve them. Quite strange…

Can you help me please?

Here’s the code:

```auto

//the container
var page = new MovieClip();
addChild(page);

function completeTest(e:Event){//Event.COMPLETE listener
	
	//delete old movie
	if(page.numChildren > 0){
		loader.unLoad(); //loader here is an instance of a class of mine called FileLoader. unLoad() calls unload() to the internal Loader instance.
		page.removeChildAt(0);
	}
	
	var swf = e.target.currentLoadedFile; //currentLoadedFile is a prop of FileLoader
	page.addChild(swf);
        //Here i cannot immediately retrieve page.width and page.height (they're == 0)
        //if I then for example, resize the window, then I can retrieve them.
}

```
