Comunidad de diseño web y desarrollo en internet online

problemas con SWFObject y ExternalInterface.

Citar            
MensajeEscrito el 28 Abr 2008 01:25 pm
Hola foro..
Estoy tratando de llamar a una funcion en AS desde Javascript haciendo uso de externalInterface pero... no me sale..

aqui mi codigo AS [ As2 ]

Código :

function callMeFromJavascript() {
      mensaje_txt.text = "El mensaje que vino de Javascript";
}

Codigo HTML

Código :

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>movie</title>
    <script type="text/javascript" src="swfobject.js"></script>
   
</head>
<body bgcolor="#ffffff">
   <div id="flashcontent">
      <strong>You need to upgrade your Flash Player</strong>
      This is replaced by the Flash content. 
      Place your alternate content here and users without the Flash plugin or with 
      Javascript turned off will see this. Content here allows you to leave out <code>noscript</code> 
      tags. Include a link to <a href="swfobject.html?detectflash=false">bypass the detection</a> if you wish.
   </div>
    
   <script language="javascript">
      var so = new SWFObject("movie.swf", "flashId", "600", "500", "8", "#336699");
      so.addParam("allowScriptAccess", "always");
      so.addParam("wmode", "transparent");
       so.write("flashcontent");
      
      function a()
      {
         var myFlashMovie = document.getElementById("flashId");
         myFlashMovie.myFunctionId();
      }
   </script>
    
   <input type="button" value="Llmar" onClick="javascript:a()" />
</body>
</html>


var connection = ExternalInterface.addCallback("myFunctionId", null, callMeFromJavascript);

salu2 ^^

Por Zandy

Claber

1345 de clabLevel

5 tutoriales

Genero:Masculino   Premio_Secretos

firefox
Citar            
MensajeEscrito el 28 Abr 2008 01:38 pm
Shit.. el problema era que no habia hecho el import de la libreria :lol:
pueden cerrar el post si quieren ... (y)

Por Zandy

Claber

1345 de clabLevel

5 tutoriales

Genero:Masculino   Premio_Secretos

firefox

 

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