复制代码 代码如下:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import flash.external.ExternalInterface;
import flash.system.Security;
import mx.controls.Alert;
import mx.events.FlexEvent;
public var callBackInfo:String = "";
public function doSend():void{
var call:FlexApp = new FlexApp("Hello",callBack);
}
public function callBack(info):void{
Alert.show(info);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<s:Panel>
<s:Button label="Send">
</s:Button>
</s:Panel>
</s:Application>
复制代码 代码如下:
package
{
public class FlexApp
{
public function FlexApp(param:String,func:Function)
{
func.call(null,"收到");
}
}
}
(编辑:武林网)
新闻热点
疑难解答