I've seen the example in
http://www.thescripts. com/forum/thread694359.ht ml
but I still have problem about javascript. (I use SWFObject)
My Action Script
My Javascript & HTML
have anything wrong? thank you
http://www.thescripts. com/forum/thread694359.ht ml
but I still have problem about javascript. (I use SWFObject)
My Action Script
Code:
import flash.external.ExternalInterface; var success:Boolean = ExternalInterface.addCallback("thisMethod",this, test); function test(){ displayTxt.text = "OK"; }
My Javascript & HTML
Code:
<script type="text/javascript" src="swfobject.js"></script> <SCRIPT LANGUAGE="JavaScript"> <!-- function pause() { var flash = document.getElementById("mymovie"); flash.thisMethod(); } //--> </SCRIPT> <div id="flashcontent">This text is replaced by the Flash movie.</div> <script type="text/javascript"> var so = new SWFObject("test.swf", "mymovie", "200", "80", "8"); so.addParam("flashvars", "filename=music.mp3"); so.addParam("allowScriptAccess", "always"); so.write("flashcontent"); </script> <INPUT TYPE="button" value="Pause" onclick="pause()">