我有一个带iframe的flex应用程序。这个iframe中有一个HTML,如何在html的js中调用flex方法? 的xmlns:mapFrame = “http://code.google.com/p/flex-iframe/”
public function test(str:String):void{
trace('params from js'+str);
}
<mapFrame:IFrame id="frm" source="mapHtml/overlay.html" height="90%" width="100%" />
答案 0 :(得分:0)
https://github.com/flex-users/flex-iframe/tree/master/examples/CallIFrameFunction
说你的iframe的ID名为iFrameWithJSfunctions
,然后我们可以像if iFrameWithJSfunctions.callIFrameFunction('showAlert');
iframe的来源一样调用javascript,我们可以调用js的函数名showAlert
这可能会对你有所帮助!!