Flash
  Home arrow Flash arrow Page 5 - The Power of LoadVars Object
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

The Power of LoadVars Object
By: Adi Reddy Mora
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 28
    2005-02-09

    Table of Contents:
  • The Power of LoadVars Object
  • Advantages of the LoadVars class
  • Receiving the variables in server-side script
  • Using LoadVars Object for loading data from text files
  • LoadVars.decode

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Power of LoadVars Object - LoadVars.decode


    (Page 5 of 5 )

    This method can be used to internally decode name/value pairs into object properties and values. It accepts one argument as a string that contains name/value pairs and the string will be converted into object properties and associated values.

    Name/value pairs look like the following:
    myvariable=value&myothervariable=anothervalue

     

    This hidden method will convert the above name/value pairs into two properties "myvariable" and "myothervariable." The values of these properties are the associated values in the name/value pair string, so the value of "myvariable" in the above string is "value" and the value of "myothervariable" in the above string is "anothervalue." Here's a little code example to show you what this method does:

    // create a new instance of the LoadVars object
    vat lv:LoadVars = new LoadVars();

    // call the method with name/value pair string
    lv.decode("name=Jhon&age=22");

     

    // iterate over all the properties in the ‘lv’ object
    for(var i in lv){
        //trace the property name and property value
        trace(i+":"+ lv [i])
    }


    The output of the above code will be:

    name:Jhon
    age:22

     

    Conclusion

     

    The LoadVars Object is the powerful way to obtain simple communication with any server or fo loading data from text files. However, for complex data communication it is recommended to use WebService Connector component available in Flash MX 2004 Professional, or you can also use Flash Remoting MX for an effective and efficient method of communicatio. Flash Remoting MX uses Action Message Format (AMF), a binary message format designed for the ActionScript object model, which was modeled on the Simple Object Access Protocol (SOAP).AMF uses a packed format to relay information so the communication with the server will be efficient.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · I am Adi Reddy Mora, the author of this article from India. This is my 1st article...
       · Hi, I am a newbie in Flash. I am interested on your topic here. I have a problem on...
       · Flash does not deal with the proxy settings. If you are able to connect through...
     

    FLASH ARTICLES

    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks
    - Building Preloaders






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT