It seems not to be working:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="600" height="300" id="externalInterface" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="sgame.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="sgame.swf" quality="high" bgcolor="#ffffff" width="600" height="300" name="externalInterface" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
And in the AS3 code:
import flash.external.ExternalInterface;
ExternalInterface.addCallback("retrieveChar", function(theData){
//stuff
});
Here is the JavaScript:
document['externalInterface'].retrieveChar('test');
I can't see anything wrong with it.