flex 调用 js

<?xml version="1.0" encoding="utf-8"?> 
<!-- http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applications-using-the-externalinterface-api/ --> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
        layout="vertical" 
        verticalAlign="middle" 
        backgroundColor="white"> 
  
    <mx:Script> 
        <![CDATA[ 
            private function callJavaScript():void { 
                ExternalInterface.call("js方法名"); 
            } 
        ]]> 
    </mx:Script> 
  
    <mx:Button label="Say 'Hello World'" 
            click="callJavaScript();" /> 
  
</mx:Application>

你可能感兴趣的:(JavaScript,xml,Flex,Blog)