3 Replies Latest reply on Oct 20, 2006 5:26 AM by GentleG

    temporarily disabling a movieclip for hittest

    GentleG
      Hi

      I want to temporarily disable a movieclip,
      so hittest won't return a true.

      The example:
      I have 4 answers (movieclips)
      that can be dropped on 4 questions (movieclips)
      but I want the questions to appear one after the other

      If I first place all 4 questions and make all but the first invisble
      The invisible movieclips still retrun a true on hittest

      How can I disable this?

      Thank you
        • 1. Re: temporarily disabling a movieclip for hittest
          TimSymons Level 1
          Will setting the "enabled" property to false do what you want?

          question_mc.enabled = false;

          I know this disables the "button-like" features of the movieclip but I'm not sure that it will disable the hittest feature.


          Tim
          • 2. Re: temporarily disabling a movieclip for hittest
            TimSymons Level 1
            Never mind, just tried it and it doesn't work. I think your best bet would be to move them off the visible stage until they are needed.

            question_mc._visible = false;
            question_mc._x = -1000; // Moves it off the stage.

            Then when you want them to be active, place them back onto the stage:

            question_mc._visible = true;
            question_mc._x = 50;


            You don't have to set the _visible property to false, I just do that so there is not a chance that the movieclip gets rendered onto the screen for a split second before it gets moved off. It avoids any chance of the information just flashing on the screen.

            Tim

            • 3. Re: temporarily disabling a movieclip for hittest
              GentleG Level 1
              Thanks for the reply Tim

              No this didn't work
              It would only allow me to disable 'the answers being dragged'
              Not the 'questions not to be hittest=true'

              I think I'll just use an extra counter with an if statement

              Thansk again

              Cheers