S 3.0 uses a new method for parsing XML that follows the E4X (ECMAScript for XML) standard. This new method of working with XML in Actionscript is more streamlined and straightforward. XML is a way to store data that is very descriptive because the data describes itself. Using XML allows you to use Flash with dynamic data in a standardized way.

There are some key features of and XML document.

  • root node – first and last node of the document, sometimes referred to as document node
  • elements – unit of XML data delimited by tags
  • attributes – data element within and opening element tag
  • text node
    • textual content placed within an opening and closing tag
    • CDATA is used to escape characters that my be problematic within a text node

(Please refer to Ch. 11 of Foundations in Actionscript 3.0 for more details on E4X and XML).

The classes used to load external XML are similar to those used for loading external content, but there is a new XML class that allows for E4X parsing.

One nice feature of E4X is the ability to create different search criteria to quickly scan your loaded XML document and retrieve the nodes or elements that you want to work with at run time. Selecting XML objects in this way returns an XMLList, which may be thought of as an array of XML Objects.

Adobe shows an example of how one might select the books by specific publisher with this technique.

These are some additional tutorials on parsing XML in AS 3.0.

Download: week 10 sample code

Homework:

1.) Work with XML and parsing XML

  • you may take an existing project
  • you may start a new project
    • if you can’t think if a project, expand upon the flv example to build a grid of thumbnails that can launch a video or enlarged image
      • you may think of this as a basic boiler plate for a portfolio site
      • reference the solution (either mine or another students’) for week 6 if you want a refresher on laying out a grid

2.) Check that your A Server is up and running

  • PHP working
  • MySQL working
  • We will working calling server-side code in class, and you may want to be working with your own accounts
  • If you use another provider for hosting, that’s fine, too.

3.) Prepare a brief proposal for your final project

  • brief description (visuals, if necessary)
  • wireframes (if appropriate)
  • precedents (other sites or projects that you are looking to as inspiration, especially if flash)
    • this is especially important if you think you want to do something that has not yet been covered in class
  • note: if you want to combine this project with a final project for another class, that is fine, but I will be evaluating your use and execution of Flash and Actionscript

Here’s a quick re-hash of the sample code for a few projects from my computation studio last year…

source

For final, I’m hoping to making something like this as a part of my thesis… we’ll see how it goes.

Advertisements