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

Data Exchanging

It’s quite possible that your application gathers data, processes it, and then presents it—all based on information the user supplies. You’ll take a giant leap, however, when you can make your app reach out and read data from an outside source. Another step in sophistication is when your app can then send data out for others to access or just to a repository for safekeeping. Chapters 6, “Basic Data Exchange,” and 7, “Exchanging Data with Outside Services,” discuss a wide range of ways Flash can consume or publish data. In this section, you’ll learn why this is so cool.

Loading

It’s sort of a chicken and the egg question as to which comes first: reading data or writing it. In fact, all data in your app can originate in the user’s brain and get typed in. However, even in the most simple cases, loading some data from an outside source is useful because—if nothing else—you can separate the code (in your Flash movie) from the data (data you load from outside, for instance). It can be as simple as creating a text file with data and storing it adjacent to your Flash movie. Keeping data separate pays off when, for example, you can make updates for your client by just changing a couple values in a text file. Figure 3.4 shows the code for a matching game where I can change the values for “name” and “star” to create a whole new game. Naturally, planning for such changes is what makes changes easy. However, just externalizing data you expect to change is only one reason you need to load data.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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