1 Reply Latest reply on Apr 13, 2009 4:30 AM by muho_tr

    place content as desired upon export? -wont

    Steve Zeeeee Level 1

      When I generate an html page out of flash, it puts the contents upper left, instead of middle, no matter what settings I choose.

      File>publish settings>html>alignment> center center

       

      Then I always have to go to DW and body>align center

       

      Further, the content properly flexes with the browser window left and right.

      I would like to float the contents top and bottom too, so if the browser wiondow is big,

      all my stuff can be in the center instead of crammed to the top.

       

      Any thoughts?

      Thanks

       

      Flash 9 CS3

      Mac osx.4.11

        • 1. Re: place content as desired upon export? -wont
          muho_tr

          Hi there,

          Centering anything in HTML vertically is not actually possible and it will be harder an harder as time passes, because HTML is supposed to compress everything vertically starting from the top. So, if you want your swf to be in the middle of your browser, then you actually need to do it in Flash (as far as I know) and set the height of your swf to 100%. First of all you need to learn how to embed swf in HTML, search in google for javascript embeding.

           

          In Flash, firstly, these two lines are essential:

           

          stage.align = StageAlign.TOP_LEFT;
          stage.scaleMode = StageScaleMode.NO_SCALE;

           

          Set align to know how to position your objects on stage and disable scaling, so no matter what size your swf has, all you objects remain the same.

           

          stage.stageWidth;

          stage.stageHeight;

           

          This is how you get your swf's size. From now on, centering your objects is just math. I hope I helped.