Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/09/2011, 05:02
cronosmen
 
Fecha de Ingreso: junio-2008
Mensajes: 165
Antigüedad: 15 años, 11 meses
Puntos: 6
Object is undefined en ie solo...

Vereis tengo una duda/problema/marrón... Tengo un reproductor de video Flv-player js que funciona (almenos en firefox, safari...) pero que en IE (como de costumbre no...) Bueno funciona en ie9 pero me da este error:

SCRIPT5009: 'Object' is undefined
var myListener = new Object();


En ie9 da ese error pero almenos reproduce el video, en ie7 ni por asomo y nisiquiera error.... Ojala podais echarme una mano, os dejo el html con el js del reproductor

Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
  3.     <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
  5.     <title>Banner Presidencia</title>
  6.         <script type="text/javascript">
  7.        
  8.             var myListener = new Object();
  9.             var volume  = 100;
  10.             myListener.onInit = function(){ load(); mute();  play();
  11.             var cookie = getCookie('played');
  12.              if(!cookie){
  13.                 setCookie('played',true,1);
  14.             }else{
  15.                 stop();
  16.             }
  17.  
  18.             getFlashObject().innerWidth = window.innerWidth;
  19.             getFlashObject().innerHeight = window.innerHeight;
  20.         };
  21.             myListener.onClick = function(){
  22.             if(this.isPlaying == "true") {pause();}    
  23.             else {play();}
  24.         };
  25.             myListener.onKeyUp = function(pKey){};
  26.             myListener.onFinished = function(){ stop();  };
  27.             myListener.onUpdate = function(){};
  28.             function getFlashObject(){ return document.getElementById("myFlash"); }
  29.         function load(){
  30.                     getFlashObject().SetVariable("method:setUrl", "#flv#");
  31.         }
  32.  
  33.             function play(){
  34.                     //if (myListener.position == 0) {
  35.             setVolume(100);
  36.             document.getElementById('playerplay').style.display = "block";
  37.                     //}
  38.                     getFlashObject().SetVariable("method:play", "");
  39.                 }
  40.             function pause(){ getFlashObject().SetVariable("method:pause", ""); document.getElementById('playerplay').style.display = "block"; }
  41.             function stop(){ getFlashObject().SetVariable("method:stop", ""); document.getElementById('playerplay').style.display = "block";}
  42.  
  43.             function setVolume(v)
  44.             {
  45.         volume = v;
  46.                 getFlashObject().SetVariable("method:setVolume", v);
  47.             }
  48.         function mute(){
  49.         volume = (volume) ? 0 : 100;
  50.                 getFlashObject().SetVariable("method:setVolume", volume);
  51.         }
  52.  
  53.             function loadImage()
  54.             {
  55.                 var url = document.getElementById("inputImage").value;
  56.                 var depth = document.getElementById("inputImageDepth").value;
  57.                 var verticalAlign = document.getElementById("inputImageVertical").value;
  58.                 var horizontalAlign = document.getElementById("inputImageHorizontal").value;
  59.                
  60.                 getFlashObject().SetVariable("method:loadMovieOnTop", url+"|"+depth+"|"+verticalAlign+"|"+horizontalAlign);
  61.             }
  62.            
  63.             function setCookie(c_name,value,exdays)
  64.         {
  65.         var exdate=new Date();
  66.         exdate.setDate(exdate.getDate() + exdays);
  67.         var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
  68.         document.cookie=c_name + "=" + c_value;
  69.         }
  70.  
  71.         function getCookie(c_name)
  72.         {
  73.             var i,x,y,ARRcookies=document.cookie.split(";");
  74.             for (i=0;i<ARRcookies.length;i++)
  75.                 {
  76.                     x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  77.                      y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  78.                      x=x.replace(/^\s+|\s+$/g,"");
  79.                     if (x==c_name)
  80.                             {
  81.                          return unescape(y);
  82.                         }else return false;
  83.               }
  84.              
  85.         }
  86.         </script>
  87.        
  88.            <!--[if IE]>
  89.         <script type="text/javascript" event="FSCommand(command,args)" for="myFlash">
  90.         eval(args);
  91.         </script>
  92.         <![endif]-->

Código HTML:
Ver original
  1. </head>
  2.     <body style="padding:0px; margin:0px;">
  3.         <div id="playerplay" style="margin-left:600px; margin-top:400px; paddindisplay:none; background-image: url(/imagenes/pause.png); height:30px; width:30px; position:absolute; cursor:pointer;" onclick="pause()">&nbsp;</div>
  4.        
  5.         <div id="playerplay" style="margin-left:630px; margin-top:400px; paddindisplay:none; background-image: url(/imagenes/btn_play_galeria.png); height:30px; width:30px; position:absolute; cursor:pointer;" onclick="play()">&nbsp;</div>
  6.  
  7.         <div id="playermute" style="margin-left:660px; margin-top:400px; background-image: url(/imagenes/mute_vol.png); height:30px; width:30px; position:absolute; cursor:pointer;" onclick="mute()">&nbsp;</div>
  8.        
  9.         <object id="myFlash" type="application/x-shockwave-flash" data="/assets/player_flv_js.swf" width="707" height="394">
  10.             <param name="wmode" value="transparent" />
  11.             <param name="movie" value="/assets/player_flv_js.swf" />
  12.             <param name="AllowScriptAccess" value="always" />
  13.             <param name="bgcolor" value="#0119fd">
  14.             <param name="FlashVars" value="listener=myListener&interval=100&useHandCursor=0&bgcolor=000000&buffer=2"/> />
  15.         </object>
  16.  
  17.     </body>
  18. </html>