zoukankan      html  css  js  c++  java
  • flash+php+mysql

    
    
    /**
    * https://nodeload.github.com/mikechambers/as3corelib/zipball/master
    */
    
    
    
    
    package  {

    import com.adobe.serialization.json.JSON;

    import flash.display.Sprite;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.*;
    import flash.net.*;

    public class Main extends Sprite {


    public function Main() {
    requestData();
    }

    /*
    * 【jsonData】
    * {"ID":"8850","Action":"info","Name":"Facebook","Telphone":"13811836760"}
    *
    */

    function requestData():void {
    var timestamp:Number = new Date().getTime(); //时间戳
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest('http://qa.com/index.php/test/info?t=' + timestamp);

    loader.load(request);
    loader.addEventListener(Event.COMPLETE, decodeJSON);
    }

    private function decodeJSON(evt:Event):void {
    var data:String = URLLoader(evt.target).data;
    var json:Object = JSON.decode(data);
    trace("json.ID:"+ json.ID+ "\njson.Name:"+ json.Name+ "\njson.Action:"+ json.Action+ "\njson.Telphone:"+ json.Telphone);
    }

    /*
    private function configureListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.COMPLETE, completeHandler);
    dispatcher.addEventListener(Event.OPEN, openHandler);
    dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
    dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    }

    private function completeHandler(event:Event):void {
    var loader:URLLoader = URLLoader(event.target);
    trace("completeHandler: " + loader.data);

    //loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    var vars:URLVariables = new URLVariables(loader.data);

    //trace("The answer is " + vars.answer);
    //trace("The answer is " + vars.info);
    }

    private function openHandler(event:Event):void {
    //trace("openHandler: " + event);
    }

    private function progressHandler(event:ProgressEvent):void {
    trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
    }

    private function securityErrorHandler(event:SecurityErrorEvent):void {
    trace("securityErrorHandler: " + event);
    }

    private function httpStatusHandler(event:HTTPStatusEvent):void {
    //trace("httpStatusHandler: " + event);
    }

    private function ioErrorHandler(event:IOErrorEvent):void {
    trace("ioErrorHandler: " + event);
    }
    */
    }

    }
  • 相关阅读:
    python 获取文件大小,创建时间和访问时间
    url中的20%、22%、26%、7B%、%7D、28%、29% 代表真实的字符(转发)
    python3 采集需要登录的网页数据
    python3 模拟鼠标中轴滚动
    python3 爬虫小技巧,
    马拉松中级训练计划
    python 使用夜神模拟器
    Python3+mitmproxy安装使用教程(Windows)(转载)
    adb server version (31) doesn't match this client (41); killing...
    appium+python环境搭建
  • 原文地址:https://www.cnblogs.com/didi/p/2337497.html
Copyright © 2011-2022 走看看