Código:
El flash lo defino en el html con la libreria SwfObject por el rollo de la patente EOLAS:import flash.external.ExternalInterface;
ExternalInterface.addCallback( "CargaTexto", this, CargaTexto );
function CargaTexto(PTexto) {
_root.editingPane.label.htmlText = PTexto;
}
ExternalInterface.addCallback( "RecuperaTexto", this, RecuperaTexto );
function RecuperaTexto() {
return _root.editingPane.text
}
Código HTML:
<script type="text/javascript" > var flashvars = {}; var params = {}; params.wmode = "opaque"; params.allowScriptAccess="sameDomain"; var attributes = {}; attributes.id = "obedit3"; attributes.name = "obedit3"; swfobject.embedSWF("./Obedit/obedit3.swf?loadURL=obedit_load.php&saveURL=obedit_save.php", "editorflash", "475", "325", "8.0.0","", flashvars, params, attributes); </script>
Recupero el objeto swf del siguiente modo:
Código:
y las funciones están definidas así:window.onload = init;
/**
Inicialización de elementos.
**/
function init () {
GF=new oForm('PanelControl');
initMenu();
swf = getFlashMovieObject('obedit3');
CargarOpcion ("quees",0,2);
document.getElementById('_NUM_Idioma').focus();
messageObj = new DHTML_modalMessage();
messageObj.setShadowOffset(5);
}
Código:
¿Alguien sabe el porque no 've' el objeto obedit3?. /**
Se recupera el objeto flash que existe en el DOM que se indique en movieName.
**/
function getFlashMovieObject(movieName)
{
if (window.document[movieName])
{
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else
{
return document.getElementById(movieName);
}
}
/**
Envia al editor flash el texto indicado.
**/
function CargaPaginaFlash(PTexto)
{
swf.CargaTexto(PTexto);
}
/**
Recupera del editor flash el texto indicado.
**/
function RecuperarTextoFlash()
{
WTexto=swf.RecuperaTexto();
return (WTexto);
}

