Flash
  Home arrow Flash arrow Page 2 - A Simple XML-Based Searchable Database
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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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

A Simple XML-Based Searchable Database
By: Joachim Schnier
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 32
    2004-07-21

    Table of Contents:
  • A Simple XML-Based Searchable Database
  • The XML File and Tree
  • The Fla File
  • ActionScript for Search Engine Continuation
  • The Button Scripts

  • 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


    A Simple XML-Based Searchable Database - The XML File and Tree


    (Page 2 of 5 )

    The XML File

    One of the XML files used in this tutorial is shown here, starting with the XML declaration and followed by the XML tree. The XML syntax is very strict and unlike HTML is case sensitive. An opening tag (for example <models>) must be followed by a closing tag ( </models> ).

    <?xml version="1.0"?>                       
    <models>                                        
      <monica name="Monica" photo="pic_1.swf"> 
        age: 21                                                       
        eye color: dark blue
        hair color: blond
        height: 179 cm
        weight: 185 pounds
      </monica>
      <heather name="Heather" photo="pic_2.swf"> 
        age: 30
        eye color: black
        hair color: dark brown
        height: 170 cm
        weight: 145 pounds
      </heather>
      <kim name="Kim" photo="pic_3.swf"> 
        age: 25
        eye color: green
        hair color: black
        height: 163 cm
        weight: 125 pounds
      </kim>
    <models>
     

    You should always test if your file has the correct syntax by opening it in your browser window. A correct file will show up like this. (Note: On some servers, especially free servers, XML files may be altered.)

    A Simple XML Based Searchable Database

    An incorrect file will be detected by the browser and give you a false statement. I put a file in the file collection, which has one mistake (fmodels_false.xml).

    The XML Tree

    An XML file has the structure of a tree as shown in the figure below. 

    A Simple XML Based Searchable Database

    In order to get access to individual parts of the tree using ActionScript, we have to start at the root of the tree, which in this case is the root node <models>. ActionScript is based on Microsoft´s Document Object Model (DOM). Check other tutorials in the Web for that. The principal to get access to the XML tree is basically very similar to the way to get access to the inside of a movieclip. There is a root or parent and there are children. But now let´s focus on the actual Flash file. We will mainly focus on the functions related to the XML files. There is also a preloader for pics, which however will not be discussed further in detail here.

    More Flash Articles
    More By Joachim Schnier


       · I am interested in looking further into this example but can't seem to figure out...
       · You need to hop along to...
     

    FLASH ARTICLES

    - Critical Flash Vulnerability Heats Up the Web
    - More on Nonpersistent Client-Side Remote Sha...
    - Nonpersistent Client-Side Remote Shared Obje...
    - Using the Decorator Pattern for a Real Web S...
    - Using Concrete Decorator Classes
    - Delving More Deeply into the Decorator Patte...
    - The Decorator Pattern in Action
    - A Simple Decorator Pattern Example
    - Decorator Pattern
    - 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







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek