开发者

How to communicate between Actionscript 3 And ASp.NET?

i would like to know how to communicate between a flash project and an asp server.My purpose is that load machine generated xml file to flash.I know oly to commun开发者_StackOverflow社区icate between xml file and flash.Any one have solution?


You can use flash remoting. It allows a flash application to call an asp.net service (method) using remoting connection.

You will need FluorineFX or WebORB on the server side


it can be done with urlvariables and with post method

var scriptRequest:URLRequest = new URLRequest("Default.aspx");
  var scriptLoader:URLLoader = new URLLoader();
  var scriptVars:URLVariables = new URLVariables();
  scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful);
  scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);
  scriptVars.var1 = "one";
  scriptRequest.method = URLRequestMethod.POST;
  scriptRequest.data = scriptVars;
  scriptLoader.load(scriptRequest);

  function handleLoadSuccessful($evt:Event):void {
   txt.text="sent";
   trace("Message sent.");
  }

  function handleLoadError($evt:IOErrorEvent):void {
    txt.text="failed";
    trace("Message failed.")
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜