This is a simple program to resize an  image which is loaded from the user’s system. This image can be  zoom-in or zoom-out using a Horizontal Slider(HSlider).The code is shown below….

<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="" layout="vertical" width="850" height="800"> <mx:Script> <![CDATA[ import mx.effects.Effect; private var file:File; /*  This function is invoked when browse button is selected. This will create a file chooser by which we can select image */ private function click(evt:MouseEvent):void { file = new File(); file.addEventListener(Event.SELECT,file_select); file.browseForOpen("Select an image"); } /*  This function is used to get the currently selected image path */ private function file_select(evt:Event):void { img.source = File(evt.currentTarget).nativePath; } /*  change image size when the slider is moved    */ private function changeSize():void { img.width=900-temp.value; img.height=900-temp.value; } ]]> </mx:Script> <mx:HSlider x="319" y="32" minimum="200" maximum="600" allowTrackClick="true" id="temp" liveDragging="true" enabled="true" change="changeSize()"/> <mx:Image id="img" /> <mx:ApplicationControlBar x="10" y="0" width="796" id="dock" dock="true" height="55"> <mx:Button label="Click To Browse" width="791" height="36" fontWeight="bold" fontSize="21" id="but"  click="click(event);"/> </mx:ApplicationControlBar> </mx:WindowedApplication>

The output look like this…….