PDA

View Full Version : flash html page and expanding browser..



scottb1
April 14th, 2009, 11:48 PM
how can I make it so that my flash html page centers with the browser, when you expand the browser..

I have no problem with the index page, but its when going to my flash html page that I get this uneven amount of white space on the right side. For example, my index page.. when you resize the browser the page also centers itself when you expand.. but when on the flash html page you see the off-centered amount of space.

any help would be appreciated..

Scott

DFdou
April 15th, 2009, 12:00 AM
i think this maybe css problem,can u give the url to see the problem?

scottb1
April 15th, 2009, 12:14 AM
its www.scottbarajas.com

Swooter
April 15th, 2009, 05:42 AM
try wrapping a <div> around your embed code:


<div style="width:800px;left:50%;margin-left:-400px;position:absolute;top:0px;">
<object width="800" height="600">
<param name="movie" value="some.swf" />
<embed width="800" height="600" src="some.swf" type="application/x-shockwave-flash" />
</object>
</div>

scottb1
April 15th, 2009, 03:20 PM
Thanks.. I'm not to familiar with code.. so I'm assuming to copy and paste the code into my flash html page.... but where exactly am I pasting it?.. Do I need to insert my width and height ?.. or use what you gave me? .. my flash page is 1000 wide.. you have 800 ..



try wrapping a <div> around your embed code:


<div style="width:800px;left:50%;margin-left:-400px;position:absolute;top:0px;">
<object width="800" height="600">
<param name="movie" value="some.swf" />
<embed width="800" height="600" src="some.swf" type="application/x-shockwave-flash" />
</object>
</div>

scottb1
April 17th, 2009, 03:23 AM
Can someone tell me where I would place this code into my HTML code for my flash page listed below? I'm trying to get it so my flash page centers when the browser expands.. someone suggested I try this code.. but I'm not sure to where to place it.. in reference to my code listed below..


<div style="width:800px;left:50%;margin-left:-400px;position:absolute;top:0px;">
<object width="800" height="600">
<param name="movie" value="some.swf" />
<embed width="800" height="600" src="some.swf" type="application/x-shockwave-flash" />
</object>
</div>



<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>//scott barajas graphic design ::.///</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<table width="1000" height="679" border="0">
<tr>
<td align="center" valign="top"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','1000','heig ht','680','src','sbarajas_09site','quality','high' ,'pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scal e','exactfit','movie','sbarajas_09site' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1000" height="680">
<param name="movie" value="sbarajas_09site.swf" />
<param name="quality" value="high" /><param name="SCALE" value="exactfit" />
<embed src="sbarajas_09site.swf" width="1000" height="680" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
</object></noscript></td>
</tr>
</table>


</body>
</html>

johnb2
April 17th, 2009, 04:24 AM
Well the code that was suggested is based using CSS. Using CSS is what you need here; to reset the margin and then center a div. You haven't declared a div so we will do that for you.

Something like this:



<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>//scott barajas graphic design ::.///</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

<style type="text/css">
<!--
<!-- This resets the margin of any browser -->
* {
margin: 0;
padding: 0;
}

<!-- This is the div that contains your .swf -->
#wrapper {
margin: 0px auto;
width: 1000px; <!--Width of div -->
height: 680px; <!-- Height of div -->
}
-->
</style>

</head>

<body>
<div id="wrapper"> <!-- Open "wrapper" div -->
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','1000','heig ht','680','src','sbarajas_09site','quality','high' ,'pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scal e','exactfit','movie','sbarajas_09site' ); //end AC code
</script>

<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1000" height="680">
<param name="movie" value="sbarajas_09site.swf" />
<param name="quality" value="high" /><param name="SCALE" value="exactfit" />
<embed src="sbarajas_09site.swf" width="1000" height="680" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
</object>
</noscript>
</div> <!-- Close "wrapper" div -->

</body>
</html>
Basically what I did here was reset the margin, wrapped the .swf in a div called "wrapper" and then set the height to 0 and the width to auto, which centers it.

If this is all the code for your entire page, you can just copy/paste what I've supplied here but you may want to back up what you have just in case something doesn't go right.

Good luck.

scottb1
April 17th, 2009, 05:48 PM
Thanks! that did the trick.. now if I create a new.another site with these same dimensions.. can I still use this code and paste it in? or will need code have to be generated??

Thanks



Well the code that was suggested is based using CSS. Using CSS is what you need here; to reset the margin and then center a div. You haven't declared a div so we will do that for you.

Something like this:



<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>//scott barajas graphic design ::.///</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

<style type="text/css">
<!--
<!-- This resets the margin of any browser -->
* {
margin: 0;
padding: 0;
}

<!-- This is the div that contains your .swf -->
#wrapper {
margin: 0px auto;
width: 1000px; <!--Width of div -->
height: 680px; <!-- Height of div -->
}
-->
</style>

</head>

<body>
<div id="wrapper"> <!-- Open "wrapper" div -->
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','1000','heig ht','680','src','sbarajas_09site','quality','high' ,'pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scal e','exactfit','movie','sbarajas_09site' ); //end AC code
</script>

<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1000" height="680">
<param name="movie" value="sbarajas_09site.swf" />
<param name="quality" value="high" /><param name="SCALE" value="exactfit" />
<embed src="sbarajas_09site.swf" width="1000" height="680" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
</object>
</noscript>
</div> <!-- Close "wrapper" div -->

</body>
</html>
Basically what I did here was reset the margin, wrapped the .swf in a div called "wrapper" and then set the height to 0 and the width to auto, which centers it.

If this is all the code for your entire page, you can just copy/paste what I've supplied here but you may want to back up what you have just in case something doesn't go right.

Good luck.

johnb2
April 18th, 2009, 06:52 AM
Inside the wrapper div there is links to the files, you will need to change those and other attributes such as the title (maybe) and anything else that is different page to page.. Otherwise, yes you can just copy this into other pages.