kaimar
10-31-2009, 11:49 PM
Hi,
Below is the script I'm using to pass a parameter to a script in the same server (and folder) as the flash file. It gives "null" as the required variable (use_url) value, instead of what the script is giving. The script itself works, when tested in a browser.
What it should do - it receives a value for "lesson_id" variable, passes it on to a script "movie_url" and receives a response with a new variable "real_url" and it's value.
What could be the problem?
function loadFinished(event:Event):void
{
use_url = event.currentTarget.data.real_url;
}
var myString:String = LoaderInfo(this.root.loaderInfo).parameters.lesson _id.toString();
var myVariables:URLVariables = new URLVariables();
myVariables.lesson_id = myString;
var myURL:String = "movie_url";
var request:URLRequest = new URLRequest();
request.url = myURL;
request.method = URLRequestMethod.GET;
request.data = myVariables;
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
myLoader.addEventListener (Event.COMPLETE,loadFinished);
myLoader.load (request);
Below is the script I'm using to pass a parameter to a script in the same server (and folder) as the flash file. It gives "null" as the required variable (use_url) value, instead of what the script is giving. The script itself works, when tested in a browser.
What it should do - it receives a value for "lesson_id" variable, passes it on to a script "movie_url" and receives a response with a new variable "real_url" and it's value.
What could be the problem?
function loadFinished(event:Event):void
{
use_url = event.currentTarget.data.real_url;
}
var myString:String = LoaderInfo(this.root.loaderInfo).parameters.lesson _id.toString();
var myVariables:URLVariables = new URLVariables();
myVariables.lesson_id = myString;
var myURL:String = "movie_url";
var request:URLRequest = new URLRequest();
request.url = myURL;
request.method = URLRequestMethod.GET;
request.data = myVariables;
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
myLoader.addEventListener (Event.COMPLETE,loadFinished);
myLoader.load (request);