dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Dynamic background width/static foreground width?

  1. #1
    Member
    Join Date
    Apr 2004
    Location
    IA, USA
    Posts
    57

    Dynamic background width/static foreground width?

    I am trying to make a site with elements that resize dynamically depending on the browser width, but have the foreground element stay the same size all the time?

    The first part is easy to do. If I set the height and width of the Flash file in the HTML to 100%, when the browser is resized, the Flash will also resize.

    But I can't figure out the second part.

    An example of what I'm trying to do is at Rilo Kiley's website

    Another example is gskinner.com

    No matter what your browser size, the background scales and the foreground is always the same width and height.

    I am using Flash MX 2004.

  2. #2
    Not really Fat... or a Cat ^_^
    Join Date
    Feb 2006
    Posts
    63
    In the first frame of your movie use a FSCommand and set allowscale to false, that'll do the trick.

    -ganbare
    What are you going to do about it?... There's gotta be people for everything --Joan Manoel Serrat

  3. #3
    Junior Member
    Join Date
    Feb 2003
    Posts
    14
    Hi, I think I'm trying to do something similar.

    See the way the little window on gskinner.com automatically moves to the center, even if you resized the window while the flash is loaded? I need that. To do that, I guess I need to know the exact width of the browser window, or the width of my flash file that is at 100%.

    In other words, my flash is embedded 100% no scale. My actually flash file is 750px wide, but at 100%.. it could be more or less. Whatever that more or less is, the actual size, is the same size as the browser. That is want i want to know, because I want full access, don't want wasted space on side bars and such. Say I want to dynamically place my logo in the top left corner, no matter the browser's current size? My flash is centered, and with a little _xmouse test, i see that the left goes -262, and positive goes 1011. 1011 + 262 + browser chrome ~= 1280, my screen width. If I resize my browser window (not maximized), those number change correctly. The thing is, I need these values without using _xmouse, the flash already needs to know the size the flash got scretched to, or the browser area size, same thing.

  4. #4
    Junior Member
    Join Date
    Feb 2003
    Posts
    14
    found it.. it's Stage.width; Put it in a setInterval timer or a stage listener, and it'll always know the size of the browser window.

    And if I align my flash to the left instead of centering, I don't need to factor in the negative values to the left, minus the size of the original flash... and so on.

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