• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Part II: Technology > Working with Complex Data

Chapter 4. Working with Complex Data

Although computers are great at gathering, manipulating, and calculating raw data, humans prefer their data presented in an orderly fashion. The same way all the world events can be organized into a newspaper by editors, rich Internet applications (RIAs) should present just the important data. If you’re buying a house in a new town, for instance, you don’t need to know all the prices ever paid for houses, but you may want to know the median price paid in the past 90 days. Unfortunately, as the programmer, you have to sift through all the data gathered to extract just the important parts—and present it in a visually interesting way.

This chapter covers different ways to store, manipulate, and generally manage data. You’ll see how storing all data in an easily accessible way makes your job easier when it comes to extracting and presenting just the meaningful parts. The orderly data you gather in this chapter leads straight into Chapter 5, “Presenting Data,” where you’ll see ways to present the data.

I keep saying “all this data” as if all the world’s information is at your disposal. (Actually it is, as you’ll see during the discussion about linking to web services in Chapter 7, “Exchanging Data with Outside Services.”) But from where does the data come? In fact, the really cool applications you build will involve importing data from outside sources and then presenting that data inside Macromedia Flash MX 2004. There are lots of sources for outside data, including databases, web services, and other connected users. This chapter concentrates on working with data after it’s inside Flash. Realize the simplest source of data is from you, the author—just type it in. For this chapter’s apps, that’s the source of the data.

Of course, everything you learn in this chapter also applies to manipulating data gathered from outside sources. This apparent non sequitur of learning to manipulate data before you learn how to gather it actually makes sense. You’ll be better equipped to decide how the data should be gathered after you can clarify your preference for how it’s organized inside Flash. For example, only after you measure and decide which windows to dress can you order the curtains. In any event, there’s lots of interesting information about manipulating data inside Flash.

Specifically, this chapter covers the following topics:

  • Identifying the appropriate data type for variables

  • Comparing homemade (or “generic”) objects to arrays

  • Sorting arrays and parse objects

  • Structuring data for easy access and manipulation

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint