游客:
注册
|
登录
|
会员
|
搜索
|
统计
|
帮助
PHPRPC 技术交流论坛
»
PHPRPC 发展讨论区
» phprpc_as3_lite 0.9 修改了原版
‹‹ 上一主题
|
下一主题 ››
投票
交易
悬赏
活动
打印
|
推荐
|
订阅
|
收藏
标题: phprpc_as3_lite 0.9 修改了原版
excuseser
新生入学
UID 506
精华 0
积分 0
帖子 5
阅读权限 10
注册 2009-4-27
状态 离线
#1
使用道具
发表于 2010-3-26 15:59
资料
个人空间
短消息
加为好友
phprpc_as3_lite 0.9 修改了原版
增加了:
before after 函数
timeout 设置
使用方式 更接近amf
但是去除了加密算法传输。
下载在这里
例子:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();"> <mx:Script> <![CDATA[ import mx.managers.CursorManager; import org.phprpc.PHPRPC_Client; import org.phprpc.events.FaultEvent; import org.phprpc.events.ResultEvent; private var client:PHPRPC_Client = new PHPRPC_Client("http://gz.gpc.net.cn/test/php/test.php"); // private var client:PHPRPC_Client = new PHPRPC_Client("http://192.168.1.1"); private var i:Number=1; internal function init():void{ client.before=function():void{ CursorManager.setBusyCursor(); } client.after=function():void{ CursorManager.removeBusyCursor(); } client.timeout=5000;//全局设置必须在最前面 client.addEventListener(FaultEvent.FAULT,ErrorFunc); client.add.addEventListener(ResultEvent.RESULT,xxx); } internal function mytest(evt:MouseEvent):void{ client.add(1,i); } internal function ErrorFunc(evt:FaultEvent):void{ lbl.text=lbl.text+evt.message + " /出错了\n"; } internal function xxx(evt:ResultEvent):void{ lbl.text=lbl.text+evt.result.toString() + "\n"; i=i+evt.result as Number; } ]]> </mx:Script> <mx:Button label="点我" click="mytest(event)" x="10" y="10"/> <mx:Label id="lbl" text="" y="40" x="10" width="100%" height="100%" fontSize="14"/> </mx:Application>
overwhelm
新生入学
UID 1163
精华 0
积分 0
帖子 1
阅读权限 10
注册 2010-7-10
状态 离线
#2
使用道具
发表于 2010-7-10 14:01
资料
个人空间
短消息
加为好友
谢谢~·学习了,回帖是一种美德~
everyone needs reading
glasses
投票
交易
悬赏
活动
当前时区 GMT+8, 现在时间是 2010-9-9 10:34
鲁 ICP 备 06029414 号
Powered by
Discuz!
5.5.0
© 2001-2007
Comsenz Inc.
Processed in 0.010157 second(s), 9 queries , Gzip enabled
TOP
清除 Cookies
-
联系我们
-
PHPRPC
-
WAP
界面风格
----------
默认风格
phpwind