1 Reply Latest reply on Mar 21, 2009 8:09 AM by Newsgroup_User

    Trying to make a flex application scalable in its display size by using a "Host-swf" - Problem

    noby_95
      We created a flex application using Flex 3. What we are trying to do is to make this application scalable in its display size. That means we want the application to scale itself to exactly fit the size of the browser window without using a scrollbar like normal Flash-swfs do. Sadly flex application don't scale like a normal flash swf.

      To get a workaround for this we created a so called "Host-swf" with flash CS3. This Host-swf loads the flex application and adds it as a child. And voila: When calling the Host-swf our application can scale.

      We used this code to achive this:
      ------------------------------------------------------------------------------------------ ----------------
      var oUrlRequest:URLRequest = new URLRequest("Flex-Application.swf");
      var oURLLoader:Loader = new Loader();
      oURLLoader.load(oUrlRequest);
      addChild(oURLLoader);
      ------------------------------------------------------------------------------------------ ---------------

      This works perfectly as long the browser window is larger then the resolution of the host-swf (900*600) when calling the url for the application:
      Picture showing the scaling

      But it doesnt't work out when the browser window is smaller than 900*600. The application is then shown with a scrollbar, and when resizing the browser window the scrollbar is still there:
      Picture showing the application with scrollbar

      Maybe anyone already tried to achive the same thing and has a different solution for us?

      Thank you in advance!
        • 1. Re: Trying to make a flex application scalable in its display size by using a "Host-swf" - Problem
          Level 7

          "noby_95" <webforumsuser@macromedia.com> wrote in message
          news:gpsue6$rhh$1@forums.macromedia.com...
          > We created a flex application using Flex 3. What we are trying to do is to
          > make
          > this application scalable in its display size. That means we want the
          > application to scale itself to exactly fit the size of the browser window
          > without using a scrollbar like normal Flash-swfs do. Sadly flex
          > application
          > don't scale like a normal flash swf.
          >
          > To get a workaround for this we created a so called "Host-swf" with flash
          > CS3.
          > This Host-swf loads the flex application and adds it as a child. And
          > voila:
          > When calling the Host-swf our application can scale.
          >
          > We used this code to achive this:
          >
          > --------------------------------------------------------------------------------
          > --------------------------
          > var oUrlRequest:URLRequest = new URLRequest("Flex-Application.swf");
          > var oURLLoader:Loader = new Loader();
          > oURLLoader.load(oUrlRequest);
          > addChild(oURLLoader);
          >
          > --------------------------------------------------------------------------------
          > -------------------------
          >
          > This works perfectly as long the browser window is larger then the
          > resolution
          > of the host-swf (900*600) when calling the url for the application:
          > http://www.gansl-online.de/Bild1.jpg
          >
          > But it doesnt't work out when the browser window is smaller than 900*600.
          > The
          > application is then shown with a scrollbar, and when resizing the browser
          > window the scrollbar is still there:
          > http://www.gansl-online.de/Bild2.jpg
          >
          > Maybe anyone already tried to achive the same thing and has a different
          > solution for us?

          When I set the Application width and height to a percentage number, it will
          change its size based on the size of the window.