Re: [Flashcoders] String to object

2007-01-09 Thread R�kos Attila
You can do that similarly to AS2, the array notation works in AS3 as well and referring to a variable by its name is possible (as far as it is an object instance's field/property, and not a local variable). However since _root doesn't exist, you have to rethink this part a bit. Attila BA> Hi,

Re: [Flashcoders] String to object

2007-01-09 Thread eka
Hello :) in AS3 you must use the DisplayObjectContainer methods to manipulate the childs in a DisplayObject (MovieClip, Sprite, etc...) http://livedocs.macromedia.com/flex/2/langref/flash/display/DisplayObjectContainer.html You can read in the documentation the method getChildByName

[Flashcoders] String to object

2007-01-09 Thread Bart Albrecht
Hi, I'm migrating some stuff from AS2 to AS3 In AS2 I can do this: function doSomething(btnName:String) { _root[btnName]visible = false; } doSomething("exit_btn"); In AS3 I want to do the same: public function doSomething(btnName:String) { //XXX here I don't kno