# This shouldn't be too difficult - resize loaded image

**URL:** <https://forum.kirupa.com/t/this-shouldnt-be-too-difficult-resize-loaded-image/180594>\
**Category:** flash\
**Created:** [March 1, 2006, 7:46pm UTC](https://forum.kirupa.com/t/this-shouldnt-be-too-difficult-resize-loaded-image/180594 "2006-03-01T19:46:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasper](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rasper](https://forum.kirupa.com/u/Rasper)\
**Post date:** [March 1, 2006, 7:46pm UTC](https://forum.kirupa.com/t/this-shouldnt-be-too-difficult-resize-loaded-image/180594/1 "2006-03-01T19:46:20Z")

</div>

I’m loading several images inside a frame, but the images will have different aspect ratios. My goal is to load all images so that the width or height does not exceed the frame.  
The ‘difficult’ part is to maintain the aspect ratio of the image.

Does anyone have a script I can work with? I’m not aware of any \_scale function that scales **both** the height and width of an image (so the aspect ratio is maintained), something like that would be usefull!

Thanks in advance.
