Enter the mx.effects.Resize class. Using this object you can control the resizing of an image when the user passes their mouse over the image. For example, you have a thumbnail image that you are displaying that is 150 by 150 pixels in your MXML file:
<mx:Image source="yourImgPath/imgName.jpg"You want to enlarge the image to a size of 450 by 450 pixels based on the action of a user. Instead of a link to a larger image, we will enlarge the image when the user passes their mouse over the image. To do this you can utilize the mx.effects.Resize class. Enter the following into your MXML file:
height="150"
width="150"
/>
<mx:Resize id="resizeBig"Then, within the Image instance, modify it with the following:
widthFrom="150" widthTo="450"
heightFrom="150" heightTo="450"
/>
<mx:Resize id="resizeSmall"
widthFrom="450" widthTo="150"
heightFrom="450" heightTo="150"
/>
<mx:Image source="yourImgPath/imgName.jpg"Finally, recompile and you will see that when the user passes their mouse over the image it enlarges without the use of links to the larger image.
height="150"
width="150"
rollOverEffect="{resizeBig}"
rollOutEffect="{resizeSmall}"
/>
1 comment:
thanks for the this.. just what I needed..
Post a Comment