A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: fullscreen scale image proportionally

  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    91

    Exclamation fullscreen scale image proportionally

    I'm really close to make a "fullscreen scale image proportionally". Now i know how scale image proporcionally to width, or height. I don't know how i can combine this two scales. For explane first script is for scale width:

    Code:
    sky.height = (stage_width / old_width)*old_height;
    sky.scaleX = stage_width / old_width;
    And this is for scale height:

    Code:
    sky.width = (stage_height / old_height)*old_width;
    sky.scaleY = stage_height / old_height;
    I wonna do something like this:

    Code:
    function() {
    if (stage_width > stage_height) { 
    sky.height = (stage_width / old_width)*old_height;
    sky.scaleX = stage_width / old_width;
    }
    else if (stage_width < stage_height) {
    sky.width = (stage_height / old_height)*old_width;
    sky.scaleY = stage_height / old_height;
    }
    }
    Idea is really simple. If my web broswer have more width like height, then flash web site use first script. Else use secund script. But i'm not a programmer, so i don't know how i can make this :/

    Plz help me

  2. #2
    Member
    Join Date
    Jul 2007
    Posts
    91
    I'm add attach file.
    Attached Files Attached Files

  3. #3
    Member
    Join Date
    Jul 2007
    Posts
    91
    Well, i make this:

    http://3dh.myartsonline.com/www2/fsmode.html

    But im still not satisfied

    Here is these same script, but bacground image is on bottom.

    http://3dh.myartsonline.com/www2/fsmode2.html

    This sample looks better.
    Last edited by 3DH; 06-05-2008 at 03:47 PM.

  4. #4
    Senior Member Zoranan's Avatar
    Join Date
    May 2008
    Posts
    126
    I think it looks fine...

    Zoranan

  5. #5
    Junior Member
    Join Date
    Nov 2000
    Posts
    2
    @ 3DH: This is awesome! Just what I've been looking for. Can you please post the entire code (or even the .fla file)?

  6. #6
    Me too, i think it looks fine.
    The only glitch i saw was when you actually go beyond (what i believe to be) the real size of the image. I mean when you make the image smaller and you go smaller than the real size it seems to jump back out to the real size after a certain limit.

    apart from that i think its pretty cool.

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