Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global Variables

Status
Not open for further replies.

GGROD

Programmer
Feb 7, 2002
68
0
0
US
Lately the projects I've been working on have been going to CD instead of web. As a result, I noticed Flash has some issues. So I started investigating Director. But many of the animation and functions I perform in Flash I have not discovered a way to duplicate in Director.

I use global variables in Flash actionscript and I have read I can use globals in Director's Lingo. But I am not sure where to decare them. In flash it was in the first frame of the main timeline. Director?
 
Apart from local variables used within a function, all Flash variables are global variables and can be defined anywhere (not only in the main timeline) and accessible from anywhere.

In Director, in addition to local variables and
Code:
global
variables, there are
Code:
property
variables.
Code:
property
's scope is limited to within its script object but can be accessible from anywhere.

Code:
global
variable can be defined absolutely anywhere in the Director movie and once defined, it is available from anywhere, anytime.

To define and access global variables, you need to declare:
Code:
global someVariable
That's it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top