title: Manipulate Object if it exists in Actionscript 3.0
body: <p>I feel like I'm making a really stupid mistake but I couldn't find an answer anywhere.</p>
  
  <p>I have an instance of an object on a different layer that is keyframed to appear and disappear with an animation. I want my code to check if the object exists (at the current frame) and if it does exist, I want it to mask another object.</p>
  
  <p>My code looks something like this.</p>
  
  <pre><code>if(this.getChildByName("mouthMask") != null){
      mouth.mask = mouthMask;
  }
  </code></pre>
  
  <p>My biggest problem is that at compile time I get this error code </p>
  
  <blockquote>
    <p>"1120: access of unidentified property mouthMask"</p>
  </blockquote>
  
  <p>I've tried throwing a try catch statement around everything but that doesn't seem to work either. Any help would be appreciated</p>