A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Loader + Aspect Ratio??

  1. #1
    Senior Member
    Join Date
    Feb 2008
    Posts
    126

    Loader + Aspect Ratio??

    Hi,

    Im using loader to load in an image from my server, is there any way to specify a width value of the image loaded in but constrain it so that the width is always 100 but the height keeps the same aspect ratio as the original image?

    Thanks

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    After you set the width, the y scale will tell you the ratio you're at:

    obj.width = 100;
    obj.scaleY = obj.scaleX;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center