A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: problems with generated HTML

  1. #1
    Senior Member
    Join Date
    May 2001
    Location
    USA
    Posts
    595

    problems with generated HTML

    Ok I was driving myself nuts trying to get my Flash movie to be centered vertically. I made a table at 100% and everything is ok. But it won't work unless I DELETE a few pieced of code. This is generated from Flash MX 2004 before I enter the table.

    Why doesn't this read just plain < html > ? If I take this out it works. Is this a setting in Dreamweaver or Flash?
    -----------------------------------
    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    < html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
    ------------------------------------

    If I delete this it works. Where is this setting?


    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> align="middle"
    Last edited by mallen; 10-28-2003 at 10:19 PM.

  2. #2
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    that code is part of the w3c specification for xhtml. It generates your page according to a .dtd (which you're probably only aware of if you deal with xml) Although only the transitional dtd (../xhtml1/DTD/xhtml1-transitional.dtd)and not the strict one this may be the problem if there are errors in your coding as xhtml is less fault tolerant, without this code your document is just plain html.

    If you want me to tell you the best way to center a flash movie in a page horizontally and vertically just let me know.

  3. #3
    Senior Member
    Join Date
    May 2001
    Location
    USA
    Posts
    595

    HTML code

    Thanks. But why does Flash generate this code? Is there a way to remove it? Also that "align" tag. Can I set Flash up to not generate this?

  4. #4
    Member of the Flashist Party
    Join Date
    Nov 2001
    Posts
    146
    I would love to know how to center flash vertically. I use < div align="center" > to center horizontally.
    If you can't convince them,
    confuse them...

  5. #5
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    Flash generates that code because of the specification for HTML 4.0. The align=middle isnt being called by that piece of code, i think it might be a problem caused by the dtd because of problems with your code. To center a flash movie on the screen vertically and horizontally you need to do this.

    Create a table with a width of 100% and height of 100%, inside this place one row, within this row place one piece of table data with align set to center and valign set to middle. This way the movie will always be centered regardless of browser size.
    PHP Code:
    <table width="100%" height="100%">
    <
    tr>
        <
    td align="center" valign="middle"

        
    FLASH CODE HERE

        
    </td>
    </
    tr>
    </
    table
    You can do this to center anything, for example you could nest an entire table inside this td, this would center the table.

    Hope this helps.

  6. #6
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    The problem is that line of code sets your browser from "strict" to "quirks" mode. Things like table height=100% aren't really valid according to W3C, or at least that's what I've heard recently.

  7. #7
    Senior Member
    Join Date
    May 2001
    Location
    USA
    Posts
    595

    using CSS instead

    That's what I hear that setting your tables to 100% is not the correct standard anymore. And it wond work with the code above. i have heard its best to start using CSS? Anyone else hear of this? I know Dreamweaver MX 2004 has made many changes to keep to the new standards of using CSS instead of many tags ect.

  8. #8
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    For forward compatibility it is best to use xhtml alongside css. However, using css for total control of the layout of your page can be tricky. If you're not comfortable with html then xhtml and css will be even more of a problem for you. The code that i gave you above will perfectly align a flash movie horizontally and vertically in the browser window, if it isnt working for you then there must be an error in your code. If you cant get it to work then feel free to contact me and i'll amend your code for you. It really is simple though to achieve what you want, if you have a copy of dreamweaver simply create a new html document, insert the code i gave u above between the two body tags. Click between the td tags and go insert, media, flash and choose your swf. this will give the desired effect.

  9. #9
    Senior Member
    Join Date
    May 2001
    Location
    USA
    Posts
    595
    Thanks but I have centered it ok after tweaking the code. I was more concerned about the idea of CSS and using it over the traditional table set at 100% since Flash is generating that code above. Until know I didn't know that the old way was being phased out.

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