Home > Web Front-end > JS Tutorial > Interactive implementation code of JavaScript and ActionScript_javascript skills

Interactive implementation code of JavaScript and ActionScript_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:21:56
Original
1233 people have browsed it
Copy code The code is as follows:




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};

The above is the method in as calling js

The following is the method in js calling as
Copy code The code is as follows:




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);}
Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template