Get a data from PHP:
1.Create a Dynamic Text and set them instance name="sta_txt".
2.Select the First Frame and Press F9.
Copy the Code below and paste it.
3.Create a PHP file in same directory and name it sample.php.Code:var req:URLRequest=new URLRequest("sample.php"); var loadder:URLLoader=new URLLoader(); //Load a Data in Variable Format. loadder.dataFormat=URLLoaderDataFormat.VARIABLES; //Load a Data from PHP try { loadder.load(req); } catch (error:Error) { trace("Unable to load requested document."); } loadder.addEventListener(Event.COMPLETE,com); function com(event:Event):void { var va:URLVariables=new URLVariables(loadder.data); trace("OK"); sta_txt.text=va.message; }
Copy the Code below and paste it.
and run it.Code:<?php /** * @author * @copyright 2008 */ print("message=My first Flash CS3 Tutorial\nIf you like this tutorial give some Reputation\nThanks By Satheesh kumar."); ?>
Demo:http://www.svprmstudio.com/PHP/
If you like this Tutorial give some Reputation.
Thanks.
By Satheesh kumar.
Edit:
Please rate this Tutorial.


LinkBack URL
About LinkBacks


Reply With Quote


