• 【设为首页】
  • 【收藏闪客居】
当前位置:主页>FLASH AS 编程>AS基础篇>AS 3.0>文章内容
  • As3 模拟As2.0 LoadVars传参
  • 来源:egoldy flashblog 作者:egoldy 2008-02-17 【

AS3.0 中已经没有了loadVars. 对于习惯使用AS2.0 loadVars传参的可以参考一下.

var myRequest:URLRequest = new URLRequest("http://www.webstudio.com.cn/msg.php");
var myLoader:URLLoader = new URLLoader();
var myVariables:URLVariables = new URLVariables();

myLoader.addEventListener(Event.COMPLETE, loadSuccessful);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, loadError);

myVariables.var1 = "hello";
myVariables.var2 = "hi";

myRequest.method = URLRequestMethod.POST;
myRequest.data = myVariables;

myLoader.load(myRequest);

function loadSuccessful($evt:Event):void
{

trace("参数已发送");
}

function loadError($evt:IOErrorEvent):void
{

trace("发送失败.");
}




上一篇:45度深度排序(as3.0)   下一篇:随机运动的瓢虫(AS3)
  • 用户名:新注册) 密码: 匿名评论
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)


FLASH源文件

Copyright © 2006-2008 flashas.net All Rights Reserved.
网站内容咨询: admin#flashas.net (#为@) 联系QQ:40777822 浙ICP备06033001号
(本网站最佳浏览解析度为1024*768, 建议使用IE 6.0或以上版本浏览器。)