title: How to display a text/movieclip for some seconds and remove an object in Action script 3
body: <p>I am beginner programmer in flash (actionscript3) , and I want to make a short Point And Click style game,</p>
  
  <p>I have a room with a Door which needed key to open and a Box which contains Key for the Door.
  I made it right you can watch SWF file(the link down my question). but I have 2 problems :</p>
  
  <p>1- when I click on Box , I see inside the box and when I pick up the key , and return to the 
  room , and again I click on Box , I see the key again , but I don't want this happen , what should I do ? remove it ? how ?</p>
  
  <p>2- when I click on Door , text "key needed" appears , but I want to disappear it after 3 seconds for example. How can I do this ?</p>
  
  <p>If I should put my codes , just tell me and I will put them here.</p>
  
  <p>this is what I made : <a href="http://apple-pib.persiangig.com/Point_And_Click.swf" rel="nofollow">http://apple-pib.persiangig.com/Point_And_Click.swf</a></p>
  
  <p>this is my code about the Key : </p>
  
  <pre><code>import flash.events.MouseEvent;
  
  stop();
  
  key.addEventListener (MouseEvent.CLICK , keypickedup ) ;
  
  function keypickedup (event : MouseEvent ) : void {   
  canyouopendoor =true;
  key.visible = false;
  
  
  }
  </code></pre>
  
  <p>and my code about Door :</p>
  
  <pre><code>import flash.events.MouseEvent;
  
  stop ();
  keyneeded.visible = false;
  
  door.addEventListener (MouseEvent.CLICK , thedoor ) ;
  
  function thedoor (event : MouseEvent ) : void {
  if (canyouopendoor ==true) {
  gotoAndStop (4);
  }
  
  else {
  keyneeded.visible = true ;
  
  }
  
   } 
  </code></pre>
  
  <p>Best Regards'</p>