www.webdeveloper.com
Results 1 to 9 of 9

Thread: Centering Flash Websites??

  1. #1
    Join Date
    Aug 2006
    Posts
    9

    Centering Flash Websites??

    Hi people,

    I've designed a website in flash but I don't know how to center it horizontally as well as vertically. I know that if I ad a <center> tag, that centers it horizontally only. Does anyone know how to center it so that when you re-scale your browser, the website remains centered horizontally and vertically?

    The code at the moment is this:

    <title>main</title>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <center>
    <object classid="clsid:d28cdb6e-ae6d-12cf-97b7-444772540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="910" height="500" id="main" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="main.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="main.swf" quality="high" bgcolor="#ffffff" width="910" height="500" name="main" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </center>
    </body>
    </html>


    For an example to see what I mean look at http://www.louisvuitton.com

    Your help would be greatly appreciated,
    Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    484
    use a table!
    Natdrip :P
    "water go down the hole" - plucky duck

  3. #3
    Join Date
    Aug 2006
    Posts
    15
    Yep - table's quickest. It's a bit of a blag and SEO boys'll frown, but hey - it's flash, no search engine can read it anyway!
    Tim

    e-Smartz Developer

  4. #4
    Join Date
    Mar 2006
    Location
    Northern UK :((
    Posts
    668
    Change your width and height to percentages (100% on both)
    99 little bugs in the code, 99 bugs in the code, fix one bug, compile it again ... 101 little bugs in the code

    An important petition, regarding your human rights:
    https://www.change.org/en-GB/petitio...r-both-genders

  5. #5
    Join Date
    Aug 2006
    Posts
    15
    Quote Originally Posted by wh666-666
    Change your width and height to percentages (100% on both)
    If you mean when you publish the movie out of Flash - don't. It blows all the fonts, pictures, everything and looks horrible.

    If you want to hvae a liquid site in flash it is possible. You use the Stage object and more specfically the Stage.onResize() function. You are then in the business of dynamically attaching movieclips from the library.

    There are some good tutoriasl out these, I can't remember the urls at the mo, but the help in Flash isn't too bad for the Stage object.
    Tim

    e-Smartz Developer

  6. #6
    Join Date
    Mar 2006
    Location
    Northern UK :((
    Posts
    668
    I meant what i said, create the swf then alter the html to 100% width and height, it doesnt affect the formatting and looks exactly the same on all screens. I create flash website on a 17" and can view it in 14",15",17",19" etc. It doesnt matter at all what resolution/screen size you use
    99 little bugs in the code, 99 bugs in the code, fix one bug, compile it again ... 101 little bugs in the code

    An important petition, regarding your human rights:
    https://www.change.org/en-GB/petitio...r-both-genders

  7. #7
    Join Date
    Aug 2006
    Posts
    15
    I disagree - if you are setting the swf to 100% then it looks rubbish. If you are setting the table that holds it to 100% that's different.

    Setting the swf to 100% DOES NOT WORK if you want to have a good looking site.
    Tim

    e-Smartz Developer

  8. #8
    Join Date
    Mar 2006
    Location
    Northern UK :((
    Posts
    668
    We'll have to agree to disagree worthyashes as ive set the swf to 100% on alot of sites and never had a problem before but i was suggesting to alter the table (ie. html) to 100%. Ive done that before as well and works fine

    Anyway looking at the site again through firefox 1.5 i dont have a problem with alignment at all, only with the height as i get a small scroll.
    Last edited by wh666-666; 08-15-2006 at 06:22 AM.
    99 little bugs in the code, 99 bugs in the code, fix one bug, compile it again ... 101 little bugs in the code

    An important petition, regarding your human rights:
    https://www.change.org/en-GB/petitio...r-both-genders

  9. #9
    Join Date
    Aug 2005
    Location
    mars
    Posts
    223
    don't use a table they slow down your browser! put it into this:

    Code:
    <div style="margin: 0 auto;">
    //embed stuff
    </div>
    Last edited by crazycoder; 08-18-2006 at 05:09 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles