The Externalinterface class is the class that flex4 flash interacts with the container's solid information. Official definition: The Externalinterface class is used to support direct communication between ActionScript and SWF containers (for example, HTML pages containing JavaScript or desktop applications that use Flash player to play SWF files) programming interfaces with programs.
With the Externalinterface class, you can invoke ActionScript functions in the Flash runtime using JavaScript in an HTML page. The ActionScript function can return a value, and JavaScript will immediately receive it as the return value for that call. This feature overrides the fscommand() method.
Externalinterface.call ("Createxmltext", xmlstr);
The call method is an important method of Externalinterface: Calling a function exposed by the SWF container, passing 0 arguments, or passing multiple parameters. The JS method in the "Createxmltext" container, "xmlstr" is passed to the parameters of the JS method.
Using the Flash Builder tool, the corresponding HTML will be generated in the Bin_debug folder, just add the JS method to the file.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
FLEX4 Flash-to-container information interaction