On Mon, 21 Mar 2005 01:33:55 +0100, Krzysztof Szlapinski <[EMAIL PROTECTED]> 
wrote:

> Let's say I've got a string variable that holds the id of an object in my
> application:
[snip]

> How can access this object with only this string id?

The application object holds references to these objects using their
ids.  Think of the application object like this:

  class MyApplication extends Application {
    var vbox:VBox; // refers to <mx:VBox id="vbox">
  }

So you can get to the vbox by looking it up in the application object:

  import mx.core.Application;

  var vboxId:String = "vbox";
  trace(Application.application[vboxId].height);  // height of
<mx:VBox id="vbox">

You can do this from anywhere in the your application.  You have to be
careful when you have nested applications though --
Application.application refers to the _top-level_ application.  See
also: UIObject.parentApplication.

Manish


 
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