Flash
  Home arrow Flash arrow Page 5 - Working with external data in Flash
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

Working with external data in Flash
By: Adi Reddy Mora
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 22
    2005-05-11

    Table of Contents:
  • Working with external data in Flash
  • getURL(), loadVariables(),loadVariablesNum(), loadMovie(), and loadMovieNum() methods
  • LoadVars Class
  • MovieClipLoader class
  • XML Class
  • XMLSocket Class

  • 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


    Working with external data in Flash - XML Class


    (Page 5 of 6 )

    Extensible Mark-up Language (XML) is the future standard for exchanging structured data in Web based applications. Data in Flash can be integrated with servers that use XML technology to build sophisticated and effective, rich Internet applications.

    ActionScript in Flash has a built-in XML class whose properties and methods can be used to load, parse, send, build, and manipulate XML document trees.

    The methods load(), send(), and sendAndLoad() of the XML Class use HTTP or HTTPS protocol to send and load information as XML.

    The load() method downloads XML from a URL and places it in an ActionScript XML object.

    The send() method encodes the XML object into an XML document and sends it to a specified URL using the POST method. If specified, a browser window displays returned data.

    The sendAndLoad() method sends an XML object to a URL. Any returned information is placed in an ActionScript XML object.

    Apart from the above methods, the ActionScript XML Class has several other methods to let you structure the XML data in Flash to send to a server, and also to manipulate and interpret downloaded XML data from the server or file system. Methods and properties such as childNodes(), hasChildNodes(), attributes, firstChild, createElement(), and so forth let you parse and create XML files at run-time.

    Now let us see a simple example for loading an external XML file into flash. 

    Example:

    // create a new XML object

     
    var sample_xml:XML = new XML();
    
     
    // load the XML into the sample_xml object
     
    sample_xml.load("sample.xml");
     
    // set the ignoreWhite property to true to ignore white spaces and
    new line characters in the XML document (default value is false)
     
    sample_xml.ignoreWhite = true;
     
    // onLoad event handler function which fires after the loading of
    XML file is complete
     
    sample_xml.onLoad = function(success) {
     
     // you can perform actions on the loaded XML here
     
    };

    More Flash Articles
    More By Adi Reddy Mora


     

    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 6 hosted by Hostway
    Stay green...Green IT