PDA

View Full Version : Resize on image load if the size is bigger than the stage?



cRoss05
June 16th, 2009, 07:05 AM
Hi! how can i resize a large image when it loads to the stage?let say resize the image to 500x500 when the image loads?
Because im having a problem when flash upload a large image. The fill.outline_mc is the outline of the uploaded image because theres a template that covers the image, but when the image is too big, it seems like the outline_mc wont scale but it works great when it mirrors a normal size image.



private function onClickSave(e:MouseEvent):void{
jagFileRefSave.browse([imagesFilter]);
jagFileRefSave.addEventListener(Event.SELECT, selectedFile);
}
private function selectedFile(e:Event):void{
jagFileRefSave.load();
jagFileRefSave.addEventListener(Event.COMPLETE, loaded);
}
private function loaded(e:Event):void{
var rawBytes:ByteArray = jagFileRefSave.data;
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, getBitmapData)
loader.loadBytes(rawBytes);
}
private function getBitmapData(e:Event):void{
container_mc.image_mc.addChild(loader);
fill.outline_mc.visible = true;
upload_Image.mouseEnabled = false;
clear_Image.mouseEnabled = true;
template.mouseEnabled = true;
fill.outline_mc.width = container_mc.image_mc.width;
fill.outline_mc.height = container_mc.image_mc.height;


}

}

Thanks.