Google Answers Logo
View Question
 
Q: centering flash movies ( Answered 5 out of 5 stars,   2 Comments )
Question  
Subject: centering flash movies
Category: Computers > Internet
Asked by: rocketeer-ga
List Price: $20.00
Posted: 31 Oct 2002 15:22 PST
Expires: 30 Nov 2002 15:22 PST
Question ID: 94727
I have created a flash 4 website using a flash movie size of 640 x
480. I would like the movie centered and to show the entire movie
screen in
IE whatever size the user has scaled his IE window. I would like to
know how to do this
Answer  

The following answer was rejected by the asker (they reposted the question).
Subject: Re: centering flash movies
Answered By: kyrie26-ga on 31 Oct 2002 16:23 PST
 
Hello rocketeer-ga,

Setting a Flash movie to fit within a browser window and to scale
accordingly, regardless of the size of the browser window, can be set
in the Publish Settings of your Flash file :

1. Select File, Publish from the main menu, or press Shift+F12.

2. Click on the third tab, "HTML".

3. Select Window Mode : "Window"

4. Select HTML Alignment : "Default"

5. Select Scale : "No Border" OR "Exact Fit". 

6. Select Flash Alignment : Horizontal:"Center" AND Vertical:"Center"

Accept the changes and publish the file, and it should have the
desired result. If not, experiment with the settings, especially for
items no. 4 and 5. You will also want to experiment with user
scenarios by changing the browser window size and seeing how the Flash
movie resizes accordingly. Item no. 5 would be the most important
here, try both settings and see how it responds.


Sources :

Lycos Help & How-To - Publish with Flash 4
http://howto.lycos.com/lycos/step/1,,116+23467+13786,00.html

Lycos Help & How-To - More HTML Settings
http://howto.lycos.com/lycos/step/1,,116+23467+13792,00.html



Google Search Terms :

center fit flash 4 movie OR movies
://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=center+fit+flash+4+movie+OR+movies


If you are still having problems with this, please do not hesitate to
post a Request For Clarification before you rate this answer. I would
be more than happy to work with you on it until you find the solution.
Happy Flash-ing and thanks for using Google Answers.


Regards,

kyrie26-ga
Reason this answer was rejected by rocketeer-ga:
The answer provided was simply wrong. The answerer had obviously never
tried it.

Perhaps you guys can trap answers that include words like "try" or
"experiment" as they are pretty good indicators that the answer isn't
even recognized by its author as "on target".

Subject: Re: centering flash movies
Answered By: tox-ga on 06 Nov 2002 19:28 PST
Rated:5 out of 5 stars
 
Alright, this is slightly more complicated then merely exporting the
Flash movie...Assuming that you want to keep the flash movie in an
html file and not by itself (accessed with a .swf extension)...
Then do the following:

1. Include all the tags of a regular html document i.e.
<html>,<head>,<body>, etc, I assume you know how to do so.

2. If you are using an html editting program, import your flash file.

3. Save your html file and open it in wordpad or textpad or something,
something that allows you to see the code.

4. Within the <body></body> tags, you should see something that looks
like:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,29,0"
width=100% height=100% align="middle" width="640" height="480">
        <param name="movie" value="Untitled-1.swf">
        <param name=quality value=high><param name="SCALE"
value="exactfit">
        <embed src="Untitled-1.swf" align="middle" quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" scale="exactfit"></embed>
      </object>

5. Scan that part for the the 'value' varable and make sure it equals
'exactfit'

6. Set the 'align' variables so they equal 'middle'

7. This is a tricky part, can you see the '<object' right at the
beginning of the chunk of code?  replace that with:
<object id="myMovie"
Actually, id can be named anything, as long as you remmeber what it
was called.

8. Now, just before '<object', paste the following chunk of code:
<table width="100%" height="100%" border="0" align="center"
cellpadding="0" cellspacing="0"><tr><td align="center"
valign="middle">

9. just after '</object>', paste the following chunk of code:
</td></tr></table>

10. Now, find the <BODY> tag in your html file. Replace the tag with
the following code:
<BODY bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" onResize="movieResize('myMovie');"
onLoad="movieResize('myMovie');">
*if you didn't use myMovie in step 7, replace myMovie with whatever
you used

11. Just after your <head>, paste in the last piece of code.
You have some choices here.  If you want a border surrounding your
flash file use the following chunk of code:
<script language="JavaScript" type="text/JavaScript">
function movieResize (flashMovie) {
if (document.body.clientHeight/document.body.clientWidth >= 0.75){
eval(flashMovie+".height=(document.body.clientWidth-13)*0.75");eval(flashMovie+".width=document.body.clientWidth-13;")}
else { eval(flashMovie+".height=(document.body.clientHeight-9)");eval(flashMovie+".width=(document.body.clientHeight-9)*1.3333");}
}
</script>

If you want the flash file to goto the edge, use:
<script language="JavaScript" type="text/JavaScript">
function movieResize (flashMovie) {
if (document.body.clientHeight/document.body.clientWidth >= 0.75){
eval(flashMovie+".height=(document.body.clientWidth)*0.75");eval(flashMovie+".width=document.body.clientWidth;")}
else { eval(flashMovie+".height=(document.body.clientHeight)");eval(flashMovie+".width=(document.body.clientHeight)*1.3333");}
}
</script>

An example of this is located at
http://artanis.hypermart.net/example.html

It should work now, enjoy.

-Tox-ga

Clarification of Answer by tox-ga on 06 Nov 2002 19:35 PST
O and one more thing, for step 11, if you don't care about aspect ratio, use:
<script language="JavaScript" type="text/JavaScript">
function movieResize (flashMovie) {
eval(flashMovie+".height='100%'");eval(flashMovie+".width='100%'");
} </script>

Ask me if you want any more functions...

-Tox-ga

Request for Answer Clarification by rocketeer-ga on 09 Nov 2002 08:12 PST
The answer from tox-ga appears very quaified. I am not sure however
that the way I explained the problem allowed him or her to make the
correct assumption about what I am trying to do. At issue is the
statement provided with the answer "Assuming that you want to keep the
flash movie in an html file and not by itself (accessed with a .swf
extension...)

I am using html simply to load the first flash movie, which then
begins both playing this movie (.swf) and loading the next (.swf). At
the end of the first movie, it jumps to the second, which then begins
playing and loading the third. So that I only download one html
document, but (in this case) 18 .swf movies.

From what I understand, the html document sets the scaling and
location of the all the movies. This document is generated by flash
according to the HTML parameters that is set in its Publish Settings
menu. The menu allows 3 options for scale: Default (Show all), No
borders, and Exact fit, and 5 options for HTML_Alignment: Default,
Left, Right, Top and Bottom. I am sure I have tried every combination
but none did what I want.

There is a web site www.paion.com that appears to do exactly what I
want. My local flash expert tells me he think they achieved what they
did using cascading style sheets. But it would seem to me that it
could be done with some code in the html document. Perhaps tox-ga's
answer takes this into account. But it seems they assumed something
different since therir answer appears more complex than would be
required to do what at the surface appears relatively simple.

Clarification of Answer by tox-ga on 09 Nov 2002 09:15 PST
rocketeer-ga,
I have visited the site.  So am I understnading that all you want to
do is center the flash movie and have it stay a constant size?

-Tox-ga

Request for Answer Clarification by rocketeer-ga on 09 Nov 2002 10:13 PST
Dear tox-ga

You got it. Whatt I want to do is center the movie, and make sure it
doesn't reduce below the 640 x 480 resolution that I think is required
to read the type clearly. I would also like it scale up to a bigger
(than 640 x 480) browser window, if it could be done without screwing
up the aspect ratio. But the essential thing is to get it centered
like the paion.com presentation.

Clarification of Answer by tox-ga on 09 Nov 2002 10:31 PST
rocketeer-ga,

Alright, what http://www.paion.com/ did is they first made an html
table and they set the width and height of that table to be 100%. 
Then, they made the horizontal alignment of the table equal to center.
 Inside that table, they made another table where they placed all
their content.
Since the horizontal alignment of outer table is centered, the inner
table will be always centered.
Is that what you were looking for?
If you could post some pictures or link to your current site, I think
I could be more specific.

-Tox-ga
rocketeer-ga rated this answer:5 out of 5 stars
Answer was right on target. Thanks

Comments  
Subject: Re: centering flash movies
From: atomm-ga on 31 Oct 2002 15:31 PST
 
Simply put all the html tags related to the flash movie between
<CENTER> tags. The html tags are usually OBJECT and EMBED, depending
on the browser, so for best results, nest an EMBED tag inside the
OBJECT structure. (Most web design that specifically support Flash
will do this for you.)
Subject: Re: centering flash movies
From: kyrie26-ga on 07 Nov 2002 05:41 PST
 
Hello rocketeer-ga,

I'm disappointed! I was prepared to work with you until you came to a
solution, all you had to do was post a Request For Clarification and I
would have been more than happy to assist you. I have worked with
Flash 4 myself and this has worked for me. Was I way off target?

kyrie26-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy