Calling JavaScript from ActionScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NitinSawant
    Contributor
    • Oct 2007
    • 271

    Calling JavaScript from ActionScript

    Hello,
    I'm beginner to actionscript, I've defined following function in script tag of page

    Code:
    <script type="text/javascript">
    function showMessage(){
            alert("javascript says: Hello ActionScript");
    }
    </script>
    i want to call it from actionscript,

    what i've already wrote is:

    Code:
    import flash.external.ExternalInterface;
    
    on (press) {
    	//mx.controls.Alert.show("Hello, world!");
    	ExternalInterface.call("showMessage()");
    }
    neither it shows the alert, nor calls the showMessage function,

    reply
  • unauthorized
    New Member
    • May 2009
    • 81

    #2
    Don't you mean ExternalInterfa ce.call("showMe ssage") instead of ExternalInterfa ce.call("showMe ssage()") ?

    Comment

    • NitinSawant
      Contributor
      • Oct 2007
      • 271

      #3
      Got it..

      Thanks a million...

      Comment

      Working...