Comunidad de diseño web y desarrollo en internet online

External Interface me vuelve loco!!! :twisted:

Citar            
MensajeEscrito el 20 Feb 2007 12:13 pm
Hace rato que estoy dando vueltas con esto: :twisted: :twisted: :twisted:

ahora les paso el código así dejo que él hable por mi

esto es html

Código :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Untitled Document</title>
      <script src="js/swfobject.js" type="text/javascript"></script>
      <script>
         window.onload = function (){
                                //mi primer intento, da el mismo resultado
            //var so = document.getElementById("Videoplayer");
            //alert(so)
            //so.callPlay('swf/k.swf')
             getMovieName("Videoplayer").callPlay('swf/k.swf')
    
             /* This utility function resolves the string movieName to a Flash object reference based on browser type.  notaran, es un cut&paste*/
             function getMovieName(movieName) {
             if (navigator.appName.indexOf("Microsoft") != -1) {
             return window[movieName]
             }
             else {
                return document[movieName]
                }
             }
            
         }
      </script>
   </head>

   <body>
      <div id="swf">
      </div>
      <script>
         var so = new SWFObject("swf/vid.swf", "Videoplayer", "350", "200", "7", "#336699","true");
         so.addParam("allowScriptAccess", "always");   
         so.write("swf");
      </script>
      <a href="#" onclick="">apreta ac� mierda</a>
   </body>
</html>



y esto AS 2

Código :

import flash.external.*;
//-----
function playMedia (file:String):Void{
   loading_mc._visible = true;
   curr_vid = file;
   netStream.close ();
   vid_holder.my_video.clear ();
   vid_holder._visible = false;
   status_txt.text = "Cargando...";
   netStream.play (file);
}
//-----
var callPlay:String = "callPlay"
var callObject:Object = null;
var flashPlay:Function = playMedia
ExternalInterface.addCallback(callPlay,callObject,flashPlay)



la cosa es que no pasa nada. nada de nada. El debugger me dice que tanto esto getMovieName("Videoplayer").callPlay
como esto
so.callPlay('swf/k.swf')
no son funciones.

:twisted: :twisted: :twisted:

Alguien tiene alguna idea de que está mal?

Por el_itur

142 de clabLevel



Genero:Masculino  

Argentina

firefox
Citar            
MensajeEscrito el 05 Mar 2007 05:37 pm
Al parecer este tema no tiene muchos amigos.

Por el_itur

142 de clabLevel



Genero:Masculino  

Argentina

firefox
Citar            
MensajeEscrito el 06 Mar 2007 02:28 am
Nunca me metí con esto y ahora entiendo porqué hay tan pocos post al respecto.

Se supone que debería ser fácil.

Código :

import flash.external.*
_root.mytxt.text = ExternalInterface.avaiable \\ undefined :twisted:


Se supone que external interface está disponible, la clase está en el sistema de archivos y la convinacion browser/os es supuestamente soportada (IE/win32, firefox/win32).

ya no se más que hacer

Por el_itur

142 de clabLevel



Genero:Masculino  

Argentina

firefox

 

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