function loadImage(image){
 this.holder.loadMovie(image);
 var imageLoaded:Boolean=false;
 this.onEnterFrame = function() {
         imageLoaded=this.holder.getBytesLoaded()==
this.holder.getBytesTotal();
         if (this.holder._width>0 && this.holder._height>0 && imageLoaded)
{
                 resizeHolder();
                 delete this.onEnterFrame;
         }
 };
}
function resizeHolder()
{
 var aMMbasedComponentInstance:Boolean=false;
 var availableWidth:Number = aMMbasedComponentInstance? this.__width :
this._width;
 var availableHeight:Number = aMMbasedComponentInstance? this.__height :
this._height;
 //to keep scale use the following line, to strech remove the following
line
  var biggerDimension=availableWidth>availableHeight? availableWidth :
availableHeight;
  this.holder._width=availableWidth;
  this.holder._height=availableHeight;
}

all you need to do is call loadImage("someimage.jpg");

On 11/2/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:

I did not write out the entire solution because I was focusing on the
specific functionality.

When you use a holder clip, you're going to be creating it and removing
it on the fly.

this.holder.removeMovieClip();
this.createEmptyMovieClip("holder", 10);
this.holder.loadMovie("some.jpg");

Easy peasy.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to