Comunidad de diseño web y desarrollo en internet online

SWFObject 2.1 no me funciona en firefox

Citar            
MensajeEscrito el 15 Sep 2008 10:44 pm
He seguido el metodo SWFObject para insertar mi SWF valga la rebundancia. Lo he hecho a través del SWFObjectgenerador 1.1 Mi página es http://www.carrerascandi.net/eric y el código es:

Código :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
      <title>portfolio</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <script type="text/javascript" src="swfobject.js"></script>
      <script type="text/javascript">
         swfobject.registerObject("portfolio", "9.0.0");
      </script></head>
   <body bgcolor="#CCCCCC">
   <div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" align="middle" id="portfolio">
            <param name="movie" value="portfolio.swf"><param name="BGCOLOR" value="#CCCCCC"><param name="SCALE" value="noborder">
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="portfolio.swf" width="100%" height="100%"align="middle">
            <!--<![endif]--><center><img src="imagenes/eric carreras candi portfolio.jpg" width="127" height="35">
               <a href="http://www.adobe.com/go/getflashplayer">
                  <img src="imagenes/get_flash_player.gif" width="112" height="33" alt="Get Adobe Flash player" >
               </a></center>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
     </object>       </div>
   </body>
</html>

Pues bien el problema es que en firefox no me funciona en internet explorer SI

Gracias

Por eriko

36 de clabLevel



 

Barcelona

firefox
Citar            
MensajeEscrito el 15 Sep 2008 11:11 pm

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox
Citar            
MensajeEscrito el 17 Sep 2008 02:31 am
El problema era "a grandes rasgos" que mi SWF contenia los "parametros" (por llamarlo de alguna manera) o la caracteristica de que tiene el Width y el Height a 100%. En cuanto cambiaba esto por pixeles concretos (estables). Firefox muestra el documento.

He solucionado el problema siguiendo las FAQs (en Inglés) de los SWFObject (http://code.google.com/p/swfobject/wiki/faq)

De hecho es mi problema consistia en la primera de ellas:

1. How can I create a SWF that will encompass 100% of the browser window?
(no lo habia tenido en cuenta porque IE no habia problema)

En fin como tampoco domino demasiado el inglés lo que he hecho ha sido cortar pegar la primera parte del código que me ofrecen para especificarle (según lo que yo he entendido) al HTML que mi documento va a estar en 100% Width y Height.

El codigo que ya funciona es:

Código :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>portfolio</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
var params ={bgcolor: "#CCCCCC", menu: "false"};
var attributes = {};
swfobject.embedSWF("portfolio.swf", "portfolio", "100%", "100%", "9.0.0", "", flashvars, params, attributes);
</script>

</head>
<style type="text/css" media="screen">
  html, body, #containerA, #containerB { height:100%; }
  body { margin:0; padding:0; overflow:hidden; }
</style>

<body bgcolor="#CCCCCC">
<div id="portfolio" align="center"><br>
<img src="imagenes/eric carreras candi portfolio.jpg" width="127" height="35">
<a href="http://www.adobe.com/go/getflashplayer"><img src="imagenes/get_flash_player.gif" width="112" height="33" alt="Get Adobe Flash player" ></a>
</div>

</body>
</html>


lo he limpiado un poquito pero la parte que me ha dado la solucion al problema ha sido:

Código :

<style type="text/css" media="screen">
  html, body, #containerA, #containerB { height:100%; }
  body { margin:0; padding:0; overflow:hidden; }
</style>


Como ya funciona no querido profundizar mas pero en la página de las FAQs te explican un poco más del porqué que consiste en que "because Firefox (or: any Gecko based browser) in standards compliant mode (or: using a valid DOCTYPE) interprets percentages in a very strict way (to be precise: the percentage of the height of its parent container, which has to be set explicitly):"

Mi página: http://www.carrerascandi.net/eric

Hastaluego

Por eriko

36 de clabLevel



 

Barcelona

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.