Flash
  Home arrow Flash arrow Page 3 - 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  
Dedicated Servers  
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 / 26
    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 - Receiving the variables in server-side script


    (Page 3 of 5 )

    You can access the flash variables in the server-side script normally, in the same way you access form POST/GET variables. The variable names will be the names you use when associating the variables to the LoadVars Object.

    Example 1 (ASP): Request(“ type”);

    Example 2 (PHP): $_POST['type']

    Example 3 (ColdFusion): #FORM. type#  

    Sending variables back to flash from server:

    You can also send variables back to flash from the server. You just need to print the data on the server-side page for flash to read that data in the following format:

    &name=John&id=342&ecode=e123

    In the above string name, id and ecode are the variable names that can be used in flash to read the data. You can pass as many variables as you require by seperating them with ampersand (&) symbol.

    Example 1 (ASP):

    You can use Response object to write the data in ASP

    Response.Write("&name=John&id=342&ecode=e123")

    Eample 2 (PHP):

    You can use print or echo language constructs to write data in PHP.

    echo "&name=John&id=342&ecode=e123";

    Eample 3 (ColdFusion):

    You can use <cfoutput> tag to output data to flash.

    <cfoutput>&name=John&id=342&ecode=e123</cfoutput>

    The LoadVars class consists of three methods for communicating with the server.

    • LoadVars.load
    • LoadVars.send
    • LoadVars.sendAndLoad

    We have seen the usage of LoadVars.sendAndLoad method for sending and receiving data to and fro from the server.

    Similarly, based on your requirements, if you want to only receive the data from the server, you can use LoadVars.load method with the parameter URL to load data from the server.

    LoadVars.load("asp_net_php_page");

    If you want to only send data to the server you can use the LoadVars.send method.

    LoadVars.load("asp_net_php_page", "_blank", "POST");

    More Flash Articles
    More By Adi Reddy Mora


       · 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
    - 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
    - Fun Things to Do with Movie Clips in Flash MX







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway