5 Replies Latest reply on Jul 9, 2008 1:21 PM by LinkMc

    Dynamically Resize Flex Layout

    LinkMc
      I am using flex inside a coldfusion page and would like to know how to dynamically make my swf height to fit my application.

      I have a search application and the details text get cut off. now I could make it scroll but would like to be able to make the swf height expand so my browser page can scroll. Is this possible?

      I Thought of Application.application.height but nothing. I do know the code is in the height in the page that resizes it, but if I set this to 100% can't I set the variable inside my application?

      Please help!
        • 1. Re: Dynamically Resize Flex Layout
          LinkMc Level 1
          Is there nobody out there that can answer this question. I would think this would be pretty common. I really don't want to use js, I would like to do this within flex itself.

          Thanks
          • 2. Re: Dynamically Resize Flex Layout
            LinkMc Level 1
            Is there any answers to this question. I did find browserCanvas that I can use, but I would think that flex would naturally expand its flex application below the fold of any browser if it is resized, I just cant seem to find this information.

            HELP!
            • 3. Re: Dynamically Resize Flex Layout
              Gregory Lafrance Level 6
              In your <Application> tag you can set width="100%" height="100%".

              If that does not work, maybe you can set something in the html wrapper, specifically the <embed> and <object> tags. You seem to have your Flex app in a CF page, so maybe there is something similar there.
              • 4. Re: Dynamically Resize Flex Layout
                Izzy1138
                LinkMc,
                If you are using the standard template it has css that says:
                body { margin: 0px; overflow:hidden } <- Take out the overflow:hidden. That is the first step. There is also a "<body scroll="no">". I took out the scroll='no' just to be sure. I ended up wrapping the javascript in the page in a <div>. Then I set the height to the size of the app. When the app shrinks and grow I adjust the height so the footer doesn't just sit at the end of a lot of scrolling.
                as3 --> flash.external.ExternalInterface.call( "adjustDivHeight", "950" );

                <script language="JavaScript">
                function adjustDivHeight(height) {
                e = document.getElementById( 'bigMo' );
                e.style.height = height + 'px';
                }
                </script>

                Also, a couple issues I saw with IE. Does the list ever end.

                // if we've detected an acceptable version
                // embed the Flash Content SWF when all tests are passed
                AC_FL_RunContent(
                "src", "acuminderFX",
                "width", "762",
                "height", "100%",
                "align", "middle",
                "id", "acuminderFX",
                "quality", "high",
                "bgcolor", "#ffffff",
                "name", "acuminderFX",
                "flashvars",'base=https://www.jnjvision.com/',
                "allowScriptAccess","sameDomain",
                "type", "application/x-shockwave-flash",
                "pluginspage", "https://www.adobe.com/go/getflashplayer",
                "wmode", "transparent" <-- Get rid of IE black box
                );

                // In IE the swf comes up as a black square until you roll over it with the mouse.
                // This focuses on the swf so that IE will pass it control.
                var acuFxObj = document.getElementById( 'acuminderFX' );
                if ( acuFxObj != null ) {
                acuFxObj.focus();
                }



                If you look at https://www.acuminder.com/ you can see what I did to make it work. Also because it is secure I had to make some changes to the history.js. IE won't load it secure if you don't fix the history.js

                That should be a good start.
                • 5. Re: Dynamically Resize Flex Layout
                  LinkMc Level 1
                  Thank you so very much,

                  I have been banging my head on this since I started this project.
                  I tried it out and looks like this is going to work. All I need to do now is get the values of the height when the canvas size changes and the form size changes....

                  Again, thank you

                  P.S nice job on the Accuminder app, its got a really nice layout.

                  Link