I tried that but it appears to only check if the variable is defined,
from what I can tell, not whether it is in the DOM or not:


var Id:String = 'theBox';

if ( ! Id ) {
  createBox();
}



On Wed, Apr 2, 2008 at 11:45 AM, DreamCode <[EMAIL PROTECTED]> wrote:
>
> something like this ?
>
>
> if (!theBox){
>
>     var vBox:VBox = new VBox();
>     vBox.id = 'theBox";
>     vBox.styleName = "theBoxStyle";
>     addChild(vBox);
> }
>
> // Add content to the box or whatever....
>
>
> --API
>
>
>
>
>
>
> On Wed, Apr 2, 2008 at 11:23 AM, Anthony Ettinger <[EMAIL PROTECTED]> wrote:
>
> >
> >
> >
> >
> >
> >
> > I want to dynamically create a VBox container for messaging from
> > ActionScript, however it's unclear to me how to check if one already
> > exists given its ID.
> >
> > var vBox:VBox = new VBox();
> >
> > vBox.id = 'theBox";
> > vBox.styleName = "theBoxStyle";
> >
> > addChild(vBox); // here is where I want to check for getById('theBox')
> > in the DOM before adding a new one.
> >
> > --
> > Anthony Ettinger
> > 408-656-2473
> > http://anthony.ettinger.name
> >
>
>  



-- 
Anthony Ettinger
408-656-2473
http://anthony.ettinger.name

Reply via email to