Monday, March 22, 2010

publish settings; flash alignment

I am finally ready to publish my web site, (770x650 px) and
would like it to come up centered on the screen rather than aligned
with the left edge. I go to publish settings and select ''center''
under flash alignment, and ''default'' under html alignment. The html
alignment seems to make a difference to the location on the screen
(top, bottom, right, or left), but it has no selection for center.
How can I accomplish this?



Thank you,

Susanpublish settings; flash alignment
wrap your embed script in this



%26lt;div style=''position: absolute; top: 50%;display:
table-cell; vertical-align: middle; text-align: center; width:
100%; padding: 0;''%26gt;





%26lt;/div%26gt;publish settings; flash alignment
There are a couple of different ways to do what you are
asking.



If the flash is the only thing that will be displayed on the
screen, then you can fill the entire page with them, and use the
Stage.align setting to set it to be centered.



To do this:

First, add the following 2 lines of code to your first frame
actions.



Stage.align = ''C'';

Stage.scaleMode = ''noScale'';



Next, change your HTML publish settings Demensions to
''Percent'' and make sure the width and height are both set to 100.



Finally, you can publish your site. The flash element will
fill the screen, and the Stage.align method will cause the flash to
always be centered.





If, on the other hand, you don't want your flash to fill the
page 100%, which is often the case, I have found that the best way
to force-center is to publish with the basic settings, then edit
the HTML page. Typically, you would wrap the flash element with a
table, or div if you are CSS inclined, and use the table align
settings to force the flash to the correct place on the screen.



Something like:



%26lt;table cellpadding=0 cellspacing=0 border=0
style=''text-align:center; width:100%; height:100%;''%26gt;

%26lt;tr%26gt;

%26lt;td v-align=middle%26gt;

FLASH ELEMENT GOES HERE

%26lt;/td%26gt;

%26lt;/tr%26gt;

%26lt;/table%26gt;



This may not be perfect code, but the idea is what matters.
Wrap the flash element in something that you use to position
centered, or cause the flash to fill the screen 100%, and center it
using Actionscript methods.
I have basically taught myself action script and flash and
have edited my site by repeating patterns and replacing items, so I
do not know what it means to ''wrap my embed script''. Please let me
know where my embed script is and what it means to wrap it.



Thank you very much,

Susan
I'm sorry, but I am too new at flash and action script to
follow through with your instructions. I do know that I do not want
to stretch out the proportions of the scene, because it contains
photographs. The site is www.dreyphoto.com/test_flash , if you want
to view it. If you could let me know the exact code to center it
and exactly where to place the code, then I am sure that I could
make it work.



Thank you,

Susan
open your HTML file in your preferred text editor, ie,
NotePad/Dreamweaver/BBEdit/etc., the script that is embedding your
Flash Movie needs to be placed inside what I gave.




I hate to be so ignorant about this, but i had already opened
the html file in notepad, but am still not sure where to place the
script you gave me. Here is what is in the html file:



%26lt;html xmlns=''
http://www.w3.org/1999/xhtml''
xml:lang=''en'' lang=''en''%26gt;

%26lt;head%26gt;

%26lt;meta http-equiv=''Content-Type'' content=''text/html;
charset=iso-8859-1'' /%26gt;

%26lt;title%26gt;dreyphoto_center%26lt;/title%26gt;

%26lt;script language=''javascript''%26gt;AC_FL_RunContent =
0;%26lt;/script%26gt;

%26lt;script src=''AC_RunActiveContent.js''
language=''javascript''%26gt;%26lt;/script%26gt;

%26lt;/head%26gt;

%26lt;body bgcolor=''#000000''%26gt;

%26lt;!--url's used in the movie--%26gt;

%26lt;!--text used in the movie--%26gt;

%26lt;!--

0%

0%

0%

0%

0%

0%

0%

0%

0%

0%

0%

0%

0%

0%

0%

--%26gt;

%26lt;!-- saved from url=(0013)about:internet --%26gt;

%26lt;script language=''javascript''%26gt;

if (AC_FL_RunContent == 0) {

alert(''This page requires AC_RunActiveContent.js.'');

} else {

AC_FL_RunContent(

'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0, 0,0',

'width', '770',

'height', '650',

'src', 'dreyphoto_center',

'quality', 'high',

'pluginspage', '
http://www.macromedia.com/go/getflashplayer',

'align', 'middle',

'play', 'true',

'loop', 'true',

'scale', 'showall',

'wmode', 'window',

'devicefont', 'false',

'id', 'dreyphoto_center',

'bgcolor', '#000000',

'name', 'dreyphoto_center',

'menu', 'true',

'allowFullScreen', 'false',

'allowScriptAccess','sameDomain',

'movie', 'dreyphoto_center',

'salign', ''

); //end AC code

}

%26lt;/script%26gt;

%26lt;noscript%26gt;

%26lt;object
classid=''clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'' codebase=''
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0, 0,0''
width=''770'' height=''650'' id=''dreyphoto_center'' align=''middle''%26gt;

%26lt;param name=''allowScriptAccess'' value=''sameDomain'' /%26gt;

%26lt;param name=''allowFullScreen'' value=''false'' /%26gt;

%26lt;param name=''movie'' value=''dreyphoto_center.swf''
/%26gt;%26lt;param name=''quality'' value=''high'' /%26gt;%26lt;param
name=''bgcolor'' value=''#000000'' /%26gt; %26lt;embed
src=''dreyphoto_center.swf'' quality=''high'' bgcolor=''#000000''
width=''770'' height=''650'' name=''dreyphoto_center'' align=''middle''
allowScriptAccess=''sameDomain'' allowFullScreen=''false''
type=''application/x-shockwave-flash'' pluginspage=''
http://www.macromedia.com/go/getflashplayer''
/%26gt;

%26lt;/object%26gt;

%26lt;/noscript%26gt;

%26lt;/body%26gt;

%26lt;/html%26gt;





Also, my flash help says that if I just set the html
alignment (under publish settings) to default, then the site should
be centered, but this doesn't happen. Anyway, if you could show me
where to place the script you gave me in respect to the above
script, I could be on my way.



Thanks again for your time.

Susan
To use dzedwards method.



Add the first line (%26lt;div style=''position: absolute; top:
50%;display: table-cell; vertical-align: middle; text-align:
center; width: 100%; padding: 0;''%26gt;) before the %26lt;script%26gt;
tag in your html.



Add the second line (%26lt;/div%26gt;) after the
%26lt;/noscript%26gt; tag in your html. That should do the trick
there.
Thank you, and yes, I had finally figured out where to place
the script myself. Although, I had to change the 50% to 1%,
otherwise there was a large area of black space at the top of the
page. But now with the 1%, it looks fine. Can you explain this.
Also, I am still not sure why I couldn't just center the site
through Flash - publish settings?



Thank you,

Susan

No comments:

Post a Comment