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,
BA>
BA>
BA>
BA> I'm migrating some stuff from AS2 to AS3
BA>
BA>
BA> In AS2 I can do this:
BA>
BA> function doSomething(btnName:String)
BA>
BA> {
BA>
BA> _root[btnName]visible = false;
BA>
BA> }
BA>
BA> doSomething("exit_btn");
BA>
BA>
BA>
BA> In AS3
BA>
BA> I want to do the same:
BA>
BA> public function doSomething(btnName:String)
BA>
BA> {
BA>
BA> //XXX here I don't know what I should do
BA>
BA> }
BA>
BA>
BA> I hope someone can help me
_______________________________________________
[email protected]
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