# Cannot Set Image Size of XML Loaded Images

**URL:** https://forum.kirupa.com/t/cannot-set-image-size-of-xml-loaded-images/228005
**Category:** flash
**Created:** [June 4, 2007, 3:31pm UTC](https://forum.kirupa.com/t/cannot-set-image-size-of-xml-loaded-images/228005 "2007-06-04T15:31:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SlowRoasted](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SlowRoasted](https://forum.kirupa.com/u/SlowRoasted)
#### Post date: [June 4, 2007, 3:31pm UTC](https://forum.kirupa.com/t/cannot-set-image-size-of-xml-loaded-images/228005/1 "2007-06-04T15:31:45Z")

</div>

I’m Loading an image into a MC based on an XML file. I’m setting the initial alpha to 0, loading the image, then setting the alpha to 100 once I see that it is fully loaded. The problem is that I want the image to be resized, which is not working. Every time I check the size of the MC once the image is loaded I get 0x0. Here preload code.

```auto

function preload(num) {
	
	eval("image"+num).loadMovie(url[num],1);
	
	eval("image"+num).onEnterFrame = function() {
		
		var bytesloaded = this.getBytesLoaded();
		var bytestotal = this.getBytesTotal();
		var percent = Math.floor(bytesloaded/bytestotal*100);
		
		trace(this._width);
		
		if(percent >= 100 && this._width > 0 && this._height > 0){ 
			
			trace(this._width);
			this._alpha = 100;
			delete this.onEnterFrame; 
			
		}
	
	};
	
};

```
