开发者

Sending string across network with as3 on mobile?

Is the开发者_JAVA技巧re anyone there who can tell me how i can send a string ("example") to an ipadress on a local network via wifi in as3 on air on adroid.

Thanks in advance!

FlashCreated


I'd imagine you can just use the HTTPService class or URLRequest (if you're not using Flex) the code would be something like this:

var urlRequest:URLRequest = new URLRequest("http://192.168.1.100/test.php");

var urlVariables:URLVariables = new URLVariables();

urlVariables.testVarName = "example";
urlRequest.data = urlVariables;

sendToUrl(urlRequest);

alternatively if you want to listen to the response use a URLLoader, if you're going with Flex HTTPService basically wraps up this functionality into a single class for that just create one set the url and call myHTTPService.send([optional params if not on data]);

Let me know if this doesn't work out and what errors you get or behavior, haven't actually tried yet within an Android device but if there's variance in the approach I'd like to know as well.


So php file is resident on the computer your sending the mesange to?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜