[Flashcoders] Dynamic access of top-level variables in AS3

2006-07-10 Thread Chris McFadyen aka Grayson Carlyle
In doing web apps, we pass a lot of variables directly to the swf files. Some of these are dynamically matched using eval() to write variable values into strings. Example: Reading settings from an XML file, with %var% in the node values; we search for for these and match up "%var%" to eval("var")

[Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Chris McFadyen aka Grayson Carlyle
Maybe I'm missing something, but I don't see how I can dynamically reference variables passed via a GET string into the swf using this. Hello :) in AS3 you use directly variables in global when you use a new .as ! package { static globalVariable = {} ; // your in topLevel !!! pub

[Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Chris McFadyen aka Grayson Carlyle
flash.display.Stage is a sealed class and can't contain swf-passed variables. QUOTE or what about stage[myVar] Charles P. ___ Flashcoders@chattyfig.figleaf.com To change your subscripti

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-10 Thread eka
Hello :) in AS3 you use directly variables in global when you use a new .as ! package { static globalVariable = {} ; // your in topLevel !!! public class MainClass() { // first code in your Application // load your xml and use your global variable !!!

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Charles Parcell
this[myVar] doesn't work?? Charles P. On 7/11/06, Chris McFadyen aka Grayson Carlyle <[EMAIL PROTECTED]> wrote: Maybe I'm missing something, but I don't see how I can dynamically reference variables passed via a GET string into the swf using this. > Hello :) > > in AS3 you use directly vari

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Charles Parcell
or what about stage[myVar] Charles P. On 7/11/06, Charles Parcell <[EMAIL PROTECTED]> wrote: this[myVar] doesn't work?? Charles P. On 7/11/06, Chris McFadyen aka Grayson Carlyle <[EMAIL PROTECTED] > wrote: > > Maybe I'm missing something, but I don't see how I can dynamically > referenc

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Derek Vadneau
"Chris McFadyen aka Grayson Carlyle" <[EMAIL PROTECTED]> To: Sent: Tuesday, July 11, 2006 11:31 AM Subject: [Flashcoders] Dynamic access of top-level variables in AS3 flash.display.Stage is a sealed class and can't contain swf-passed variables.

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread eka
global[myVar]; Or if you don't like the idea of a global object, create a dynamic class to do the same. Derek Vadneau - Original Message - From: "Chris McFadyen aka Grayson Carlyle" <[EMAIL PROTECTED]> To: Sent: Tuesday, July 11, 2006 11:31 AM Subject: [Flashcoders

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Chris McFadyen aka Grayson Carlyle
That however requires putting those variables into the global object (which I don't have a problem with), but I don't know the names of these variables... that's why I need dynamic variable references. On 7/11/06, Derek Vadneau <[EMAIL PROTECTED]> wrote: Create an object in the global scope to

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Chris McFadyen aka Grayson Carlyle
; > > Or if you don't like the idea of a global object, create a dynamic class > to do the same. > > > Derek Vadneau > > - Original Message - > From: "Chris McFadyen aka Grayson Carlyle" <[EMAIL PROTECTED]> > To: >

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread eka
e the idea of a global object, create a dynamic class > > to do the same. > > > > > > Derek Vadneau > > > > ----- Original Message - > > From: "Chris McFadyen aka Grayson Carlyle" <[EMAIL PROTECTED]> > > To: > > Sent: Tues

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Derek Vadneau
ybe you could explain how you want to use it? Derek Vadneau - Original Message - From: "Chris McFadyen aka Grayson Carlyle" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Tuesday, July 11, 2006 11:50 AM Subject: Re: [Flashcoders] Dynamic access of top

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Chris McFadyen aka Grayson Carlyle
er SWF/app/browser/etc. Does that address your situation? If not, maybe you could explain how you want to use it? Derek Vadneau - Original Message - From: "Chris McFadyen aka Grayson Carlyle" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Tuesday, Jul

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Juan Anorga
Hi, You may want to check out flash.display.LoaderInfo[1]. It has a property "parameters" that has all the variables passed to the swf via querystring and flashvars. The DisplayObject at the top of the display list will have a loaderInfo property with an instance of the LoaderInfo class. Hope th

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Chris McFadyen aka Grayson Carlyle
ddress your situation? If not, maybe you could explain how > you > want to use it? > > > Derek Vadneau > > - Original Message - > From: "Chris McFadyen aka Grayson Carlyle" <[EMAIL PROTECTED]> > To: "Flashcoders mailing list" < flashcoder

Re: [Flashcoders] Dynamic access of top-level variables in AS3

2006-07-11 Thread Chris McFadyen aka Grayson Carlyle
That's the one! Thanks :D On 7/11/06, Juan Anorga <[EMAIL PROTECTED]> wrote: Hi, You may want to check out flash.display.LoaderInfo[1]. It has a property "parameters" that has all the variables passed to the swf via querystring and flashvars. The DisplayObject at the top of the display list wi