Chapter 22. Understanding Networking Basics

Introduction

In this chapter

  • Understanding URLRequest

  • Loading data from external files

  • Using URLVariables

  • Sending data via URLRequests

  • Using the Loader

  • Understanding Flash Player security

A time will come where you, like Leif Eriksson before you, will yearn to leave the fjords of Iceland, which you're accustomed to, and explore the great unknown across the Atlantic. Now, replace “fjords of Iceland” with “Flash Player” and “the Atlantic” with “the rest of the Internet” and we've got something to talk about. So what's out there? Well, for starters there's the page your SWF is embedded in, beyond that, the server your SWF file resides on, and finally, the rest of the Internet. Much like the experience of crossing the sea differs for each who crosses it, the manner in which you can communicate with these myriad locations is different: load XML, call to scripts, read AMF data, read binary information . . . the choice is yours. In the next few chapters, you explore all this.

To those of you with previous Flash experience, the LoadVars class that you were familiar with has been replaced by a much richer and more powerful set of classes that allow you more flexibility and functionality.

For starters let's talk about the basics of communicating with external files. The central concept of this basic external communication is that you create a request that contains the information about what you want to talk to—either the Uniform Resource Identifier (URI) ...

Get ActionScript™ 3.0 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.