# Scaling JPG to MovieClip container

**URL:** https://forum.kirupa.com/t/scaling-jpg-to-movieclip-container/180334
**Category:** Uncategorized
**Created:** [February 27, 2006, 9:40pm UTC](https://forum.kirupa.com/t/scaling-jpg-to-movieclip-container/180334 "2006-02-27T21:40:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jcanistrum](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jcanistrum/32/2188_2.png) [@jcanistrum](https://forum.kirupa.com/u/jcanistrum)
#### Post date: [February 27, 2006, 9:40pm UTC](https://forum.kirupa.com/t/scaling-jpg-to-movieclip-container/180334/1 "2006-02-27T21:40:18Z")

</div>

I´m loading a JPG image into an empty movie clip as an Holder.

I want to scale the JPG to the Holder´s size.

Loading is not a problem, scaling neither, but …

to get the loaded JPG \_width and \_heigth is burning my mind Ⓜ

below is the code section I´m using inside an class

```auto
                
var imgHolder = detail.createEmptyMovieClip ("imgHolder", detail.getNextHighestDepth ());
 
var my_mcl:MovieClipLoader = new MovieClipLoader ();

// Create listener object:
var mclListener:Object = new Object ();
mclListener.onLoadError = function (target_mc:MovieClip, errorCode:String, status:Number)
{
      trace ("Error loading image: " + errorCode + " [" + status + "]");
  };
 mclListener.onLoadStart = function (target_mc:MovieClip):Void 
{
      trace ("onLoadStart: " + target_mc);
 };
mclListener.onLoadProgress = function (target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number):Void 
{
     var numPercentLoaded:Number = numBytesLoaded / numBytesTotal * 100;
    trace ("onLoadProgress: " + target_mc + " is " + numPercentLoaded + "% loaded");
  };
  mclListener.onLoadComplete = function (target_mc:MovieClip, status:Number):Void 
  {
     trace ("onLoadComplete: " + target_mc._width + " " + target_mc._height);
   };
my_mcl.addListener (mclListener);
my_mcl.loadClip ("cristo.jpg", imgHolder);

```

I thougth I could get target\_mc.\_width and target\_mc.\_height after the Load is complete and then apply the proper xscale and yscale to imgHolder but I get ZERO for both.

What am I doing wrong ?

Thanks any help  
João Carlos  
Rio  
Brazil
