Flash+php+mysql

Source: Internet
Author: User
/*** 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 ();            Timestamp 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.addev            Entlistener (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.ta            Rget);                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.b        ytesloaded + "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); }        */    }    }
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.