invocar evento de clic flash desde javascript
Frecuentes
Visto 1,754 veces
0
i have a flash object in my html file
<embed id="ZeroClipboardMovie_1" src="/assets/811871e8/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="100" height="38" name="ZeroClipboardMovie_1" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=1&width=100&height=38" wmode="transparent">
how can i make click event on this object when a html button
is clicked for example ?
1 Respuestas
1
You can expose (invoke) your flash functions from javascript by using the ExternalInterface class and adding a callback.
AS3 (flash) code:
ExternalInterface.addCallback('nameForJStoCall',flashFunctionName);
Código JS:
document.getElementById('ZeroClipboardMovie_1').nameForJStoCall(yourParametersIfNeeded);
For more detailed examples: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html
Sin embargo, no puedes
tell flash to dispatch true click events externally (for security reasons). Things like invoking fullscreen mode, or a FileReference box will not work unless an element is actually clicked in flash.
Respondido el 20 de junio de 20 a las 10:06
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas javascript flash or haz tu propia pregunta.
sorry if it wasn't clear @MihaiIorga ... nope html button or java script code - Hilmi
You can communicate between java script and actionscript through External interfaces you can add event listeners in the actionscript side and on event you can call the java script functions - Triode