Return to Snippet

Revision: 1407
at October 3, 2006 11:17 by inakiabt


Updated Code
fix.js:
/*******************************************/
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}
var fixObjects = function() {
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++)
	{
	    objects[i].outerHTML = objects[i].outerHTML;
	}
};
addLoadEvent(fixObjects);
/*******************************************/

index.html:
/*******************************************/
<html>

<head>
  <title></title>
  <script>
    function aler()
    {
    	alert('a ver si anda');
    }
  </script>
</head>

<body onLoad="aler();"> <!-- si tiene o no una funcion en el OnLoad, el script funciona igual -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="760" height="100">
<param name=movie value="http://dsnet.com.ar/intro3.swf">
<param name=quality value=high>
<embed src="http://dsnet.com.ar/intro3.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="100"></embed>
</object>

<!--**************EN ALGUN "include" de php por ejemplo**********************-->
<script language="JavaScript" src="fix.js"></script>
<!--*********************************************************************-->

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="760" height="100">
<param name=movie value="http://dsnet.com.ar/intro3.swf">
<param name=quality value=high>
<embed src="http://dsnet.com.ar/intro3.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="100"></embed>
</object>

</body>

</html>
/*******************************************/

Revision: 1406
at October 3, 2006 11:16 by inakiabt


Updated Code
fix.js:
/*******************************************/
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}
var fixObjects = function() {
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++)
	{
	    objects[i].outerHTML = objects[i].outerHTML;
	}
};
addLoadEvent(fixObjects);
/*******************************************/

index.html:
/*******************************************/
<html>

<head>
  <title></title>
  <script>
    function aler()
    {
    	alert('a ver si anda');
    }
  </script>
</head>

<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="760" height="100">
<param name=movie value="http://dsnet.com.ar/intro3.swf">
<param name=quality value=high>
<embed src="http://dsnet.com.ar/intro3.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="100"></embed>
</object>

<!--**************EN ALGUN "include" de php por ejemplo**********************-->
<script language="JavaScript" src="fix.js"></script>
<!--*********************************************************************-->

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="760" height="100">
<param name=movie value="http://dsnet.com.ar/intro3.swf">
<param name=quality value=high>
<embed src="http://dsnet.com.ar/intro3.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="100"></embed>
</object>

</body>

</html>
/*******************************************/

Revision: 1405
at October 3, 2006 11:14 by inakiabt


Initial Code
fix.js:
/*******************************************/
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}
var fixObjects = function() {
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++)
	{
	    objects[i].outerHTML = objects[i].outerHTML;
	}
};
addLoadEvent(fixObjects);
/*******************************************/

index.html:
/*******************************************/
<html>

<head>
  <title></title>
  <script>
    function aler()
    {
    	alert('a ver si anda');
    }
  </script>
</head>

<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="760" height="100">
										<param name=movie value="http://dsnet.com.ar/intro3.swf">
										<param name=quality value=high>
										<embed src="http://dsnet.com.ar/intro3.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="100"></embed>
</object>

<!--**************EN ALGUN "include" de php por ejemplo**********************-->
<script language="JavaScript" src="fix.js"></script>
<!--***************************************************-->

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="760" height="100">
										<param name=movie value="http://dsnet.com.ar/intro3.swf">
										<param name=quality value=high>
										<embed src="http://dsnet.com.ar/intro3.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="100"></embed>
</object>

</body>

</html>
/*******************************************/

Initial URL

                                

Initial Description
Patch para quitar el molesto cartel en una sola linea de codigo.
Lo interesante es que hace una cola de funciones para el "OnLoad".
Mas que nada sirve si tenes un sitio armado y tenes que meter este patch en todas tus paginas.  Con la funcion "fixObjects" no alcanza, ya que asi tendria que poner el include al final de la pagina, antes del "". Con esta cola de eventos se puede meter en cualquier parte de la pagina.

Cola de eventos:  http://snipplr.com/view/412/agregar-funciones-al-page-load-sin-anular-otros-eventos-ya-agregados/

Initial Title
[FIX] Macromedia Flash - Click para activar el control - Click to activate the control

Initial Tags
javascript, flash

Initial Language
JavaScript