ASKER
Adobe Flash (formerly Macromedia Flash) is a cross-platform multimedia and software platform used to embed animations, video, and interactive applications into web pages and desktop and mobile applications and games. Flash displays text, vector and raster graphics to provide animations, video games and applications. It allows streaming of audio and video, and can capture mouse, keyboard, microphone and camera input. The ActionScript programming language allows creation of interactive animations, video games, web applications, desktop applications and mobile applications.
TRUSTED BY
I think I forgot to answer your question.
You should use onLoad method when you're expecting name-value pairs of data, because they will be automatically converted to properties so you can comfortably use them. Example:
---
data.txt:
name=John&age=35&city=New York
---
var myLoadVars = new LoadVars();
myLoadVars.onLoad = function (success)
{
if(success)
{
//here you have access to all data converted to properties of myLoadVars object
//so myLoadVars has from now on "name", "age" and "city" prop. and you can use their
//values:
trace(this.name);
trace(this.age);
trace(this.city);
}
}
myLoadVars.load("data.txt"
-----
You should use onData method when you're expecting other than name-value pairs encoded data, for example some raw text, article ... Example:
---
data.txt:
This is great article about ActionScript. It's great. Blah blah...
---
var myLoadVars = new LoadVars();
myLoadVars.onData = function (src:String)
{
//src parameter contains loaded data
trace(src); // this will trace out: "This is great article about ActionScript. It's great. Blah blah..."
// so you can assign it as is to some TextField
_root.article_TextField.te
}
myLoadVars.load("data.txt"
-----
I hope it's clear now.
Regards,
ivan_os