Working with external data in Flash - LoadVars Class
(Page 3 of 6 )
The LoadVars Class can be used in lieu of loadVariables() and loadVariablesNum() methods. It has three methods that use the HTTP or HTTPS protocol to send and load information in URL-encoded format.
This class was introduced in Flash Player 6 to provide a cleaner, much more object-oriented interface for the common task of exchanging data with a server or text files.
When compared to loadVariables() and loadVariablesNum() methods, LoadVars class has many advantages.
Example:
The following example instantiates a LoadVars object, assigns a couple of variables to it and sends those variables to a PHP page with http POST method.
var sample_lv:LoadVars = new LoadVars();
sample _lv.name = “Jhon”;
sample _lv.age = “36”;
sample _lv.send("setid.php", "_blank", "POST");
You can check the usage and advantages of LoadVars class at http://www.devarticles.com/c/a/Flash/The-Power-of-LoadVars-Object/, which gives you a clear picture of how to use it.
Next: MovieClipLoader class >>
More Flash Articles
More By Adi Reddy Mora