O'Reilly logo

Learning ActionScript 3.0 by Zevan Rosser, Rich Shupe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

An XML-Based Navigation System

If you haven't done so already, you may want to read the last exercise in Chapter 6, before continuing with this exercise. Chapter 6 discusses object-oriented programming and uses a simplified version of this exercise without XML. Instead of creating the menus with XML, it simulates the process using an array. By comparing this exercise with the more basic version in Chapter 6, you can see how incorporating XML changes the system. The result of this exercise will be a five-button navigation bar with submenus, the labels and partial functionality of which are populated through XML.

Before looking at the ActionScript for this exercise, we need to explain a couple of quick things about the directory structure and main .fla source file, las3_main_xml_nav.fla. This allows you to create your own source files if you don't wish to download the files from the companion web site.

This exercise improves upon the files used in the ongoing book project, that includes material from this text and the companion web site. As such, it uses the directory structure you started in Chapter 6. The main project directory includes the primary .fla file and the document class, LAS3Main.as. It also contains two directories for classes, com (for general packages that you may use in multiple projects), and app (for classes specific to this project that you are less likely to reuse). For each class included in this section, the code is preceded by a comment that describes where, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required