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.
Alguien tiene alguna idea de que está mal?