user327663
user327663

Reputation:

JavaScript Communication

I was reading about Flex- JavaScript communication via ExternalInterface.

But I had a doubt, it said that the javascript code should be written in the HTML file of the application ?

Now which is this HTML file ? Is it the index.template.html file per project or the HTML file created per MXML application ?

Upvotes: 0

Views: 147

Answers (3)

ymutlu
ymutlu

Reputation: 6715

this pages describe external interface very well. Most important thing to not forget is

 <param name="allowScriptAccess" value="sameDomain" />

And for better flash embeding, use http://code.google.com/p/swfobject/ .

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html?filter_flash=cs5&filter_flashplayer=10.2&filter_air=2.6

Upvotes: 0

HyderA
HyderA

Reputation: 21371

Yes, or if it's a lot of javascript, you could externalize it by including a script tag in the index.template.html file. The index.template.html file is used to generate the index.html files in bin-debug and bin-release folders.

Upvotes: 0

Vladimir Tsvetkov
Vladimir Tsvetkov

Reputation: 3013

You should better use the index.template.html, since this is the file used as a template for the HTMLs generated for each MXML application. Otherwise a simple clean on the project might delete the code you've added to the HTML file created per MXML application.

Upvotes: 1

Related Questions