8 Replies Latest reply on Oct 1, 2012 3:32 PM by kineticcreative123

    Having trouble getting an image to hide when clicked.

    kineticcreative123 Level 1

      Hi,

      I have an image where I need each text box/arrow to delete once clicked (see attached). I have converted each image to be deleted to a movie clip and am using the code below:

       

      image1.addEventListener(MouseEvent.CLICK, hideImages)

       

      function hideImages(e:MouseEvent):void{

           e.target.visible=false;

      }

       

      After clicking I want them to be gone for good after releasing the mouse. I am applying these two lines to the remaining images. It isn't working though.

       

      image2.addEventListener(MouseEvent.MOUSE_OVER, hideImages) // to mouse over event

      image2.addEventListener(MouseEvent.MOUSE_OUT, hideImages) // to mouse out event

       

       

      I am getting this compiler error:

       

       

      Scene=Scene 1, layer=event, frame=1, Line 1Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=event, frame=1, Line 3The class or interface 'MouseEvent' could not be loaded.
      Scene=Scene 1, layer=event, frame=1, Line 6The class or interface 'MouseEvent' could not be loaded.
      Scene=Scene 1, layer=email, frame=1, Line 1Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=email, frame=1, Line 2Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=drawings, frame=1, Line 1Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=drawings, frame=1, Line 2Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=callback, frame=1, Line 1Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=callback, frame=1, Line 2Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=low, frame=1, Line 1Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=low, frame=1, Line 2Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=meeting, frame=1, Line 1Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=meeting, frame=1, Line 2Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=meetinga, frame=1, Line 1Statement must appear within on/onClipEvent handler
      Scene=Scene 1, layer=meetinga, frame=1, Line 2Statement must appear within on/onClipEvent handler

       

       

       

      DOWNLOAD THE .FLA HERE

       

      Thanks!

       

      A17L01P120.jpeg