Made to Order Software Corporation Logo

Get Variable

SWF Action
Action Category: 
Variables
Action Details: 
0
Action Identifier: 
28
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (s), push 1 (a)
Action Operation: 
s1 := pop();
r := *s1;
push(r);
Action Flash Version: 
4

Pop one string, search for a variable of that name, and push its value on the stack. This action first checks for local variables in the current function. If there isn't such a variable, or the execution is not in a function, then the corresponding global variable is read.

The variable name can include sprite names separated by slashes and finished by a colon as in. Only global variables are accessible in this way.

Example:

/Sprite1/Sprite2:MyVar

In this example, the variable named MyVar is queried from the sprite named Sprite2 which resides in Sprite1.

In a browser you can add variables at the end of the movie URL (as defined in the W3C docs) and these will automatically be accessible via this Get Variable action.

Example:

my_movie?language=jp

Defines the variable language and sets it to "jp".

Since Flash V5.x, there are internal variables available to you and these can be read with the Get Variable action.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Syndicate content