Flex:
public function callFromJavaScript():String
{
test.label='dfdsfsdf';
return "1";
}
public function init():void {
ExternalInterface.addCallback("sendToFlash", callFromJavaScript);
}
HTML
<object classid='clsid:x-x-x-x-x' height='200px' width='300px'>
<param name="allowScriptAccess" value="always" />
<param name='src' value='${swf}.swf'/>
<embed name='mySwf' id='qwe' src='${swf}.swf' height='200px' width='300px'/>
</object>
I know there are multiple (JavaScript) methods like:
document.getElementById('FlexAppId').setName(name);
However:
- I have no clue which one are crossbrowser compatible (cant install IE to test out)
- I have tried multiple but I can’t get them to work(in any browser), I’m probably using the wrong id, I’ve been trial & erroring for a couple of hours but I don’t have anything working.
(I heard there was a problem with ExternalInterface.addCallback on a local file system?, should I upload the swf? < is the flex code right& problem = JavaScript/html side?)
ExternalInterfacefunctions are know to have issues across browsers and operating systems. Some of the recommendations are,swfobjector any other standard library toembedyour swf. (swfobject)idandnameto the embed tagidandnameattribute should be always same.Security.AllowDomain('domain-of-html-page.com')