I'm trying to load some text from a URL, explode the text and then save the results to variables. Here's what my AS2 actionscript looks like:
// Create the empty variables
var user_title = '';
var user_message = '';
var user_author = '';
// Load the string
var loadText = new LoadVars();
loadText.load("http://www.example.com/html_feed.php?md5=15d89cac6e77c8e3a592c05aee13bcb7");
// Save values to variables
loadText.onLoad = function(success) {
if (success) {
user_title = this.thetitle;
user_message = this.theMessage;
user_author = this.theAuthor;
}
};
And this is what the page it's trying to fetch looks like:
thetitle=Greetings&theMessage=Hello everyone!&theAuthor=Steve
When I trace the variables user_title
, user_message
and user_author
I get blank outputs. This would lead me to suspect that onLoad
part of my script isnt working.
Any pointers would be very much appreciated. AS2 and Flash Player 10 on CS5.