A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Liquid Layout Help

  1. #1
    Senior Member
    Join Date
    Jul 2004
    Posts
    102

    Liquid Layout Help

    I'm trying to build a flash liquid layout in which some items expand to the browser width/height, and others stay exact. I am controlling these elements via movie clips using as2

    Stage.align = "TL";
    Stage.scaleMode = "noScale";

    sizeListener = new Object();
    sizeListener.onResize = function() {

    video1_mc._width = Stage.width;
    video1_mc._height = Stage.height;

    };
    Stage.addListener(sizeListener);

    flash object = 100% width and height in the html

    Everything works great except for when you load the page or reload. The flash takes on the default width of the stage and does not resize until the browser window is resized. Any ideas on how to correct this?

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Well, assuming Flash knows the proper width of the stage when it begins, you could simply move the resize code into a function and call it when it starts up.

    Code:
    sizeListener.onResize = function() {
      resizeStuff();
    };
    
    function resizeStuff(){
      video1_mc._width = Stage.width;
      video1_mc._height = Stage.height;
    }
    resizeStuff();

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