thanks for the tip LD. here is the function I set up for resize
private function onResize(evt:ResizeEvent):void{
var scaleF:Number = this.height/bImage.contentHeight;
if(this.height<bImage.contentHeight){
bImage.scaleY = bImage.scaleX = scaleF;
}else{
bImage.scaleY = bImage.scaleX = 1;
}
bImage.x = (this.width/2) - (bImage.contentWidth / 2);
bImage.y = (this.height/ 2) - (bImage.contentHeight/ 2);
}
...
<mx:Image id="bImage" source="{imgsrc}" complete="imgLoaded(event)"
horizontalCenter="0" verticalCenter="0"/>
it works great, will scale the image up to its original size, then keeps
it centered.
Thanks
Russ
lar.drolet wrote:
Not sure if this will work but what if you placed your image inside of
a Canvas (100% x 100%), which is inside if your VDividedBox. Create a
listener on the Canvas for a ResizeEvent.RESIZE and call a new
function on the event. This call out may be able to stretch your
image to the proper size. Good Luck.
LD
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com>, Russell Sprague <[EMAIL PROTECTED]>
wrote:
>
> Great that works,
> any suggestions on how to get the scalled size of the image if I place
> it in the top frame of a VDividedBox, and set the image w and h to 100%
> So the image will scale to fit into the pane when the dividerBar is
dragged.
>
>
> lar.drolet wrote:
> >
> > Try this:
> > trace("iw "+bImage.contentWidth);
> > trace("ih "+bImage.contentHeight);
> >
> > LD