Kind of yes and no...

(Hello to the group by the way, new here)

Please excuse my lack of correct terminology, and number of assumptions, I think...

Once you understand the underlying structure of Flash, you realise that referencing properties, variables, and commands is very similar to referencing anything contained within an Object...

So in object "Foo", you have a property called "bar" then you reference it through foo["bar"]. The useful part is that Flash will eval() everything within those brackets. So you could also reference foo["ba"+"r"] to the same effect.

So with:
var theCommand = new commands [ commandNameToCheck ] ();

You're actually looking within the new commands structure, with the square brackets doing their job, working like an eval().

Not sure if that was useful or not, but I'm pretty sure that's how it's going down.

Dan

On 12 Apr 2006, at 11:30, Cedric Muller wrote:

I am always wrong, but:

see the [] ?
this is 'eval()' equivalent ...

so, not the same than
var myStr = "com.bob.Bar";
var myInstance = new myStr();

see ?

Are you sure?

If it doesn't, then

     var theCommand = new commands [ commandNameToCheck ] ();

definite does. It's used in ARP.

On 4/12/06, Steve Webster <[EMAIL PROTECTED]> wrote:
Hi Chris,

var qname:String = "org.foo.Bar";

var x = new qname ();

That won't work. Did you mean:

var qname:String = "org.foo.Bar";

var x = new eval(qname)();

--
Steve Webster
Head of Development

Featurecreep Ltd.
http://www.featurecreep.com
14 Orchard Street, Bristol, BS1 5EH
0117 905 5047


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Dan Efergan
[EMAIL PROTECTED]



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to