Reputation: 613
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:
Upvotes: 0
Views: 1226
Reputation: 1319
ExternalInterface
functions are know to have issues across browsers and operating systems. Some of the recommendations are,
swfobject
or any other standard library to embed
your swf. (swfobject)id
and name
to the embed tagid
and name
attribute should be always same.Security.AllowDomain('domain-of-html-page.com')
Upvotes: 4