在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
as3:
代码
var request=new URLRequest('http://localhost/test.php');
request.method = URLRequestMethod.POST; var data = new URLVariables(); var bytes:ByteArray = new ByteArray(); bytes.objectEncoding = ObjectEncoding.AMF3; //write an object into the bytearray bytes.writeObject( { myString:"Hello World"} ); data.data = bytes; request.data = data; var urlLoader:URLLoader = new URLLoader(); urlLoader.dataFormat = URLLoaderDataFormat.BINARY; urlLoader.addEventListener(Event.COMPLETE, onCompleteHandler); urlLoader.load(request); function onCompleteHandler(evt:Event):void { trace(evt.target.data); }
php:
define("AMF_AMF3",1);
$data = $_POST['data']; echo amf_decode($data, AMF_AMF3);
|
2022-08-18
2022-08-17
2022-08-15
2022-11-06
2022-08-17
请发表评论