javascript 调用flex的方法
//重要必须在Flex中执行如下注册 才能在JS中调用 private function registerCallBacks():void { ExternalInterface.addCallback("flexFunction1",jsCallBack1); ExternalInterface.addCallback("flexFunction2",jsCallBack2); ExternalInterface.addCallback("flexFunction3",jsCallBack3); } private function jsCallBack1():void { Alert.show("Call First Flex Method!"); } private function jsCallBack2(params:*):void { Alert.show("Call Method2:" + String(params)); } private function jsCallBack3():String { return Math.random().toString(); }