external interface and swfobject
Hi
I'm having some trouble with external interface and swfobject. Just can't seem to get external interface to communicate with my swf. Incidently it works when I publish it the traditional way, just not when I'm using swfobject! Any help would be appreciated!
JS:
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
var params = {wmode:"opaque", allowscriptaccess:"always" };
var attributes = {id:"movie2", name:"movie2"};
//
swfobject.embedSWF("images/movie2.swf", "movie2", "550", "400", "9.0.0", false, flashvars, params, attributes);
//
function getFlashMovie(id) {
return document.getElementById(id);
}
function stopFlash(){
getFlashMovie("movie2").commandFlash();
}
</script>
HTML:
<a href="#" name="stop" onClick="stopFlash()"><div id="next"></div></a>
AS3:
ExternalInterface.addCallback("commandFlash", stopPlaying);
|