Well, you could do:

this[id] assuming id is a String, but that doesn't guarentee it's the 
correct path.  For example, containers do some crazy nesting using _obj1 or 
something close to it, but that's the gist of it.

Keep in mind, though, you can treat id's as datatypes:

var myRef = vb01;
trace(myRef == vb01); // true
myRef.width = "50";
etc.

----- Original Message ----- 
From: "Krzysztof Szlapinski" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, March 20, 2005 7:33 PM
Subject: [flexcoders] string object id to object



hi,
this is probably a lame question but I just can't find the answer to it:
Let's say I've got a string variable that holds the id of an object in my
application:

...
var id = 'vb01';
...
<mx:VBox id='vb01' >
...

How can access this object with only this string id?
So the point is how can I have object reference if I only have its id?

krzysiek





Yahoo! Groups Links








 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to