A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: problem getting flash to center in web browser

  1. #1
    Member
    Join Date
    Jul 2001
    Location
    British Columbia, Canada
    Posts
    39

    problem getting flash to center in web browser

    Just upgraded to Flash CS4. Published .swf/.html files... Trying to get the .swf to display in the center (horizontally) of the .html page / browser window.

    Previously I used <div align="center"><object>...</object></div> but that no longer works! It displays centered from within Dreamweaver but not in any browsers I've tried. Can't for the life of me figure out why!!

    I noticed Flash CS4 now spits out a whole lotta code in the generated .html file and I'm assuming the source of the problem is somewhere within.

    The only workaround I've found so far is to publish just the .swf and manually embed it into a new .html page... but then I no longer have all the (detection) code.

    Anyone have any answers?

  2. #2
    Junior Member
    Join Date
    Jun 2009
    Posts
    4
    Code:
    <div style="text-align:center;"><object>...</object></div>
    or perhaps:
    Code:
    <object style="margin:0 auto;">...</object>

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Posts
    1
    in cs4 there is an enourmus extra amount of code that gets published now

    if you scroll way down to the bottom you will see familiarity place the div align just after the body bgcolor, then end it just before /body

    Code:
    <body bgcolor="#000000">
    <div align="center">
    ..
    ..
    ..
    </div>
    </body>
    I just tested it myself, works for me

  4. #4
    Junior Member
    Join Date
    Jun 2009
    Posts
    4
    The align attribute is deprecated. Use styles instead.

  5. #5
    Junior Member
    Join Date
    Jul 2010
    Posts
    13

    had the same problem!!!

    got it corrected by using <div align="center">

    thnks....

  6. #6
    Junior Member
    Join Date
    Jun 2010
    Posts
    29
    <div style="text-align:center;">...</div> for my JS
    ****************************************
    ****************************************
    Create standalone SWF slideshow with Premium flash templates!

    DIY slideshow template using flash template editor

    Learn more about how to make your own template and DIY fathers day ecard

Tags for this Thread

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