Search Tutorials
Variable Scope - Where to put your stuff The way Flash movies store variables is similar to the normal public/private scope used in various programming languages. What this means is that your variables are stored in memory but may or may not be available, depending on where you're trying to recall them from. Here's an example:
If we have a textbox named txtEmail in frame 1 of the FormFields layer, we'll have access to that value in our GetValues keyframe or ProcessValues keyframes on the ActionScript layer. If we have a movie clip on the main timeline on the MovieClips layer, we won't have access to the values on the main timeline of the Movie Clip. This is called variable scope. The values on the main timeline of our movie become private variables that can only be accessed by looking 'within' the right target. By using TellTarget, you can look into different locations and have access to your variables. So, variables are kind of a hybrid between public and private, depending on whether you're using Tell Target. I use an empty Movie Clip on my main timeline called Variables to store any values that I want to keep. This is great when you're only interested in one or two things supplied by the user, but you don't necessarily want to send all the values that you initially received from your CGI back to your CGI. They don't serve any purpose and only add to the overhead of the communication between the client (web browser) and server.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|