Tengo el siguiente codigo:
Código Flash:
Ver original
import flash.display.MovieClip; import flash.events.*; import flash.net.*; public class Main extends MovieClip { public function Main() { // Prepare request var request:URLRequest = new URLRequest("ejemplo.php"); request.method = URLRequestMethod.GET; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.addEventListener(Event.COMPLETE, completeHandler); loader.load(request); function completeHandler(evt:Event) { var username = evt.target.data.username; var email = evt.target.data.email; trace ('username is ' + username); trace ('email is ' + email); } } }
Código PHP:
Ver original
<?php $returnVars['username'] = "John Doe"; //send variables back to Flash echo $returnString; ?>