[OT] Re: Where Rev could be going...

Jim Ault JimAultWins at yahoo.com
Wed Nov 22 12:07:24 EST 2006


On 11/22/06 1:30 AM, "jbv" <jbv.silences at club-internet.fr> wrote:

SIDE NOTE

> I gave up with Flash as a development tool many years ago coz it's been
> one of the most frustating experiences... for instance, I never found how
> to define a global in ActionScript... but perhaps the most recent versions
> of Flash improved the situation...
> 
> JB
> 
Of, course, it does not matter to you anymore, but..
.  
This is actually very simple, and something that happens with the very first
tutorial....

root.myVariable = "data string that is global ";

...which attaches this variable to the main timeline (root).  The main
timeline is always accessible, no matter how many movie clips, etc you have.

However, since the root timeline is at the top of the object hierarchy,
there are cases where you want to refer to this variable between separate
Flash movies without embedding one in the other, then you need to use the
full or relative file path name & root.myVariable.

Theoretically, you could always define a root-stub timeline file, open it
with any other Flash fla's, then put global variables there, but I found it
far easier to do the #include directive in the ActionScript to bring in code
and variable definitions from resource text files.

Further, using 'root' is no longer the preferred way, since this leads to
ambiguity in Flash 2.0+

Jim Ault
Las Vegas





More information about the use-livecode mailing list