[ Team LiB ] |
IntroductionThere are many reasons why you may want to send and load values from and to your Flash movies. Here is a brief list of some of the possibilities:
When you are loading variables into Flash, it is important that you correctly format the values to load. Flash can interpret data in URL-encoded format. URL-encoded variables follow these rules:
Here is an example of variables in URL-encoded format: artist=Picasso&type=painting&title=Guernica&seller=Joey+Lott&room=L%27Atelier Flash 6 introduced the LoadVars class, which provides a much more robust means of sending and loading variables than the loadVariables( ) method, which was available previously. Therefore, LoadVars is the preferred means of performing these actions, and it is used for the recipes in this chapter. Refer to Recipe 11.13, Recipe 11.17, and Recipe 11.19, which demonstrate how to transmit data associated with a form. There are, of course, other ways to send and receive data in Flash. Chapter 19 covers data transmission using XML. Chapter 20 covers data transmission using Flash Remoting (see also Chapter 21 with regard to recordsets). Loading values using a LoadVars object is subject to Flash's standard security sandbox. That is, you can load variables from a text file or script only if it is within the same domain as the Flash movie. For ways around the domain security limitation, see Recipe 17.4, Recipe 15.2, and Recipe 15.6. |
[ Team LiB ] |