4Tutorial

Creating a Universal XML Load/onload Class

Introduction

In this chapter we will create our first class file. What you will learn is how to load an XML file. We will first discuss the standard way to load an XML file. However, because of problems that can occur, we will design our own XML loading class file, which we will use throughout the book.

A Regular XML Load/onLoad Script

To load an XML file we will use the load method combined with an onLoad event handler. A regular class script to load and display an XML file would be something like this:

class scripts.XML_regular {  private var myXML:XML;  private var myText:TextField;  private var myClip:MovieClip;  public function XML_regular ()  {  }  public function test (myFile:String) ...

Get Flash XML Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.