Posted By

hejaaa on 12/05/10


Tagged

php echo Complete as3 URLLoader


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Adrian
dubogii


load variables from php file


 / Published in: ActionScript 3
 

  1. import flash.events.MouseEvent;
  2. import flash.net.URLLoader;
  3. import flash.net.URLRequest;
  4. import flash.net.URLLoaderDataFormat;
  5. import flash.events.Event;
  6.  
  7. btn.addEventListener(MouseEvent.CLICK, klik);
  8. function klik(e:MouseEvent):void{
  9. var req:URLRequest = new URLRequest("check.php");
  10. var loader:URLLoader = new URLLoader(req);
  11. loader.dataFormat = URLLoaderDataFormat.VARIABLES;
  12. loader.addEventListener(Event.COMPLETE, komplet);
  13. }
  14.  
  15. function komplet(e:Event):void{
  16. infoTXT.text = e.target.data.vyhra + " - " + e.target.data.id;
  17. }
  18.  
  19.  
  20. // PHP :: check.php
  21. <?php
  22. echo "vyhra=true&id=123456";
  23. ?>

Report this snippet  

You need to login to post a comment.