import flash.external.ExternalInterface; public function invokeJavaScript():void { lblResult.text=ExternalInterface.call("returnTheName",txtName.text); } ]]>
Add method in javascript in html page function returnTheName(a){return "success! " a};
import flash.external.ExternalInterface; private function init():void { ExternalInterface.addCallback("addTo100",add);//Statement OK Called method } private function add():int { var i:int; var sum:int=0; for(i=1; i< ;100 ; i ) { sum = i; } return sum; }
]]>
Add js file in the html page Upper method function addMethod{var s= JavaScriptCallActionScript.addTo100();alert(s);}
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn