views:

19

answers:

2

I have an actionscript project, and I have provided the function that I want it to be called from HTML(the flash builder generated html file).

ExternalInterface.addCallback("getURL", getURL);

This is the code in actionscript, how can I modify the flash builder generated html file so that it can call getURL()?

+2  A: 

Just add your function between <script> tags in index.template.html file that is located in html-template folder of your project.

2DH
I add this to the html file but the browser reports error: swfobject.embedSWF( "adm.swf", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); document["adm"].getURL("kjdkfjkdjfd");
Bin Chen
try document.getElementbyId("adm") instead of document["adm"] and check if <embeded>/<object> element has its id specified at all
2DH
+1  A: 

alternatively, you don't have to use the html template, it's totally possible for you to create your own html and implement your own settings. Just go to the Project properties and uncheck the "Generate HTML..." checkbox.

as for your javascript function , you could have it in an external file and access it like this. it'd be easier to maintain, if the need to add more functions arises

<script type="text/javascript" src="external.js"></script>
PatrickS