Skip to main content
March 20, 2008
Question

Check for a child...

  • March 20, 2008
  • 6 replies
  • 536 views
Is there any way to check for a child on the stage by name?
This topic has been closed for replies.

6 replies

Inspiring
March 21, 2008
What would be the difference and when would each be used?



"Jamesabth" <webforumsuser@macromedia.com> wrote in message
news:fs0jct$c5h$1@forums.macromedia.com...
> In ActionScript there are null and undefined.


Participating Frequently
March 21, 2008
In ActionScript there are null and undefined.
Inspiring
March 21, 2008
So, testing for null is the equivalent to testing for VOID in Lingo?


"Imageinaction" <webforumsuser@macromedia.com> wrote in message
news:fs01nu$o0q$1@forums.macromedia.com...
>I think you can try something like this...
> Roberto Scordino
>
>
>
> var sprite:DisplayObject;
> sprite = this.getChildByName("Name");
> if(sprite!=null) {
> // what you want
> }


Participant
March 21, 2008
I think you can try something like this...
Roberto Scordino

March 20, 2008
right, but it doesn't tell you its there until after it throws an error, which stops my flash peice, even if I put a try catch in there...
Participating Frequently
March 20, 2008
this.getChildByName("myDisplayObject_mc");