dynamically resize main movie

Posted on 2004-10-27
Last Modified: 2010-05-18
Let's say I have a webpage with 3 rows (maximized to 100% width).  Row 1 is a header and Row 3 is a footer and will stay constant in height.  Row 2 is content and will change according to the users screen resolution. So theoretically this should work:

Row 1 & 3 movie: set stage dimensions to 640 width, create a movie symbol with bg rectangle make it's height the hieght you want the header or footer to be, at runtime AttachMovie and change it's width to match System.capabilities.screenresolutionX.  Publish movie as 100% width and blank the height setting in DW.

Row 2 - do the same thing but it's height would equal (row1 + row3) - system.capabilities.screenresolutionY

Other content elements could be added at runtime from the library in a similar method.

This should maximize the width and height for the entire screen regardless of the browsers dimensions.  You should also be able to set the justification on the table rows to center so that residual whitespace will be evened out at the sides.

But what I am getting is more akin to a swf that either doesn't fill up the main screen or is too much for the main screen OR the justification is off.  Also, I had to subtract off units of the screenresolutionX to get the attached movie to fill the screen.

I think what I am doing wrong is assuming that  a movie set to screen dimensions within another movie that is set to max width of screen dimensions would fill up the screen.

Shouldn't there be an easier way? Why can't I change the dimensions of the main movie stage at runtime via AS?  or can i?
Question by:skibama1
    LVL 27

    Accepted Solution

    You can, but beware: System.capabilities.screenResolutionX and System.capabilities.screenResolutionY are monitor sizes, not browser visible are sizes.
    See if this can help you:

    LVL 1

    Author Comment

    Can you explain your code a little bit.  That looks like what I want to do.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

    931 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now