A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [CS3] 100% swf - yet maintain aspect ratio?

Hybrid View

  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    51

    [CS3] 100% swf - yet maintain aspect ratio?

    Look for the code to do this... www.viewzi.tv

    The swf is set to 100% of the browser, yet when you resize the browser window the swf is not squished - but the aspect ratio of the video remains true. Using exactFit will cause the swf to fit exactly to the browser window, but when you resize the frame, the swf gets squished.

    anyone know how to do this?

  2. #2

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    51
    Thanks for the response. noScale just means my swf with maintain its pixel dimensions... this does not allow the user to RESIZE their browser and maintain the aspect ratio of the flv. As per the example, when you enlarge the browser window with what you are suggesting the swf just ends up floating in the middle of the window - not enlarging or shrinking with the aspect ratio maintained.

    Any other thoughts?

  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Well Flash is going to keep its aspect ratio by default, but there may be gaps on the top or side depending on the shape of your movie and the shape of your browser window.

    To get what you see on the link above, you use Stage.scaleMode="noScale", then you also write a Stage.onResize function, in which you put all your code to determine how things should resize when the browser is resized.

  5. #5
    Junior Member
    Join Date
    Aug 2004
    Location
    Florida
    Posts
    23
    This is simlar to what I want to do except that I only want the background of my fla to resize, not the central mc (which must resize but maintain aspect ratio).
    Did you get this figured out?
    Thx in advance!
    Trust No1

  6. #6
    Junior Member
    Join Date
    Aug 2004
    Location
    Florida
    Posts
    23
    This is simlar to what I want to do except that I only want the background of my fla to resize, not the central mc (which must resize but maintain aspect ratio).
    Did you get this figured out?
    Thx in advance!
    Trust No1

  7. #7
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    rdoyle720 allready gave you the answer. Look at .onResize in the liveDocs.
    For the background, if you give it Stage.width and Stage.height for both w/h, it'll fill up the window.
    gparis

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