Skip navigation
NicholasMinaj
Currently Being Moderated

How to hide/show an object on a keyframe by clicking an object on a different keyframe?

Jul 5, 2012 7:16 PM

Yeah, I'm a noob, simplest answer possible please. Thanks

 
Replies
  • Currently Being Moderated
    Jul 5, 2012 7:34 PM   in reply to NicholasMinaj

    Assign the objects instance names and use an event listener on the one you want to click and have its event handler function set the other's visible property to the opposite of what it is.

     

    oneObject.addEventListener(MouseEvent.CLICK, toggleObject);

     

    function toggleObject(evt:MouseEvent):void {

         otherObject.visible = !otherObject.visible;

    }

     

    Both objects must be present at the same time.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 6, 2012 4:25 AM   in reply to NicholasMinaj

    You cannot directly affect an object that is in another frame (that is, the frame numbers are different). 

     

    You could have a variable that is defined in a layer that extends across the frames involved.  You would set the value of that variable when you click the one object.  In the frame where the other object is you use that variable to determine if the second object should be visible or not.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points