Chapter 11. An OOP Application Framework

 <  Day Day Up  >  

Flash is notoriously open -ended. If there are several of ways to skin a cat, there are even more ways to build a Flash application. Flash's flexibility can cause confusion for developers, especially when they're building their first application. This chapter's goal is to overcome that confusion by providing one explicit example of how to structure an OOP Flash application. By no means is the example presented here the only way to create a Flash application, but it is certainly a legitimate , reusable approach that makes a good foundation for any OOP project. We'll consider the example in the abstract sense first, not in reference to any particular application. Our framework could be applied to anything from an email application to a video game. In the next chapter, we'll see how to apply our generic framework to a real-world situation ”a currency conversion application.

The application framework described in this chapter derives from a Java mentality more than, say, a Microsoft Visual Basic style. That is, our application will be a pure OOP application, in which everything happens in classes and the .fla file is used only to load classes and provide component linkage. Not every application in Flash needs to be pure OOP. Flash also fully supports drag-and-drop visual development, a la Visual Basic. Visual development practices involve placing components on stage manually at authoring time and setting component properties and data bindings via panels in the Flash authoring tool. These practices are beyond the scope of this book but are covered in detail in Flash's online Help. In particular, see Help Using Components, and if you're using Flash MX Professional 2004, see Help Using Flash Working with Screens. For a visual developer's introduction to Flash application development, see Building a Google Search Application with Macromedia Flash MX Professional , at http://www.macromedia.com/devnet/mx/flash/articles/google_search.html.

The example files discussed in this chapter are available for download at http:// moock .org/eas2/examples.

 <  Day Day Up  >  


Essential ActionScript 2.0
Essential ActionScript 2.0
ISBN: 0596006527
EAN: 2147483647
Year: 2004
Pages: 177
Authors: Colin Moock

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net