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

Chapter 8. XML Connection > Event-Driven Functionality

Event-Driven Functionality

Now that our XML reader works, let's break it. We will fundamentally reengineer the highscore object. Modern programs avoid polling when possible. But our function now is spread over four frames, as it loops around and tests the xml.loaded flag. We can do better.

onLoad Callback Function

Flash encourages us to create our own function and install it as the onLoad method. The code we install there is called (by Flash, not by us) when the whole XML file is loaded or when a load failure is recognized.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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