6 Replies Latest reply on Feb 14, 2007 8:10 AM by fo_ka

    Quick mouse movement

    fo_ka
      I’m having a small problem with my presentation.
      When my mouse gets over a bitmap button, it changes to another bitmap, when leaving the button it returns to its original state. Everything worked fine, until I accidently moved the mouse quickly over the button. The bitmap changed to its pressed bitmap but when the mouse left the button, it remained as it was, it didn’t change to the original state.

      Any Ideas? Thank you in advance
        • 1. Re: Quick mouse movement
          James Newton, ACP Level 3
          It would help to see the code that sets the member of the sprite.
          • 2. Re: Quick mouse movement
            fo_ka Level 1
            Trying to hide the original bitmap - button I move it off the screen (is there a better way?) using the following code

            ------- Original bitmap script
            on mouseEnter()
            set the locV of sprite "Industial Design" = 1208
            cursor (280)
            end mouseEnter

            and then to bring it back on the other bitmap

            ------- “pressed” bitmap script
            on mouseLeave()
            set the locV of sprite "Architecture" = 176
            cursor (-1)
            end mouseLeave


            Thank you again... :)
            • 3. Re: Quick mouse movement
              Level 7
              fo_ka wrote:
              > Trying to hide the original bitmap - button I move it off the screen
              > (is there a better way?) using the following code
              >
              > ------- Original bitmap script
              > on mouseEnter()
              > set the locV of sprite "Industial Design" = 1208
              > cursor (280)
              > end mouseEnter
              >
              > and then to bring it back on the other bitmap
              >
              > ------- ?pressed? bitmap script
              > on mouseLeave()
              > set the locV of sprite "Architecture" = 176
              > cursor (-1)
              > end mouseLeave

              It might help to increase the tempo of the movie. Also, it is more reliable
              to set a sprite's cursor rather than the system cursor, and you can simply
              change the member of a sprite rather than having two or three sprites for a
              rollover.

              -------------------------------------
              property self, spriteNum, origMember

              on mouseEnter
              self.member=member("theRolloverMember")
              end mouseEnter

              on mouseLeave
              self.member=origMember
              end mouseLeave

              on beginSprite
              self=sprite(spriteNum)
              self.cursor=280
              origMember=self.member
              end beginSprite

              on endSprite
              self.cursor= -1
              end endSprite
              -------------------------------------

              HTH

              Andrew


              • 4. Re: Quick mouse movement
                fo_ka Level 1
                I’m a new director user so I need a little help more.

                Do I place the original bitmap on the stage and copy paste this exact code on bitmap’s script? Do I place the Rollover bitmap on the stage?
                Or
                Do I somehow create a procedure (which I can use for more than one button) and then call it by rolling over the mouse feeding back to the procedure the necessary data?

                I tried the first (as described without placing the rollover bitmap on stage). The original bitmap turn off and on again very quickly and I didn’t see the rollover bitmap
                • 5. Re: Quick mouse movement
                  Level 7
                  fo_ka wrote:
                  > I?m a new director user so I need a little help more.
                  >
                  > Do I place the original bitmap on the stage and copy paste this exact
                  > code on bitmap?s script? Do I place the Rollover bitmap on the stage?
                  > Or
                  > Do I somehow create a procedure (which I can use for more than one
                  > button) and then call it by rolling over the mouse feeding back to
                  > the procedure the necessary data?
                  >
                  > I tried the first (as described without placing the rollover bitmap
                  > on stage). The original bitmap turn off and on again very quickly and
                  > I didn?t see the rollover bitmap

                  Place the original bitmap member on the stage. This creates a sprite.

                  Open the script editor (<ctrl>+0). Make sure the script type is set to
                  "Behaviour" in the Property Inspector. Give the script a name. Edit the
                  script (e.g. paste the code into it). Make sure to change the text
                  theRolloverMember to the name of the actual member to use for the rollover.

                  Drop the script member from the cast onto the sprite on the stage.


                  If you want a behaviour you can drop onto any button and be able to type in
                  the name of the member to use for the rollover, you can use this:-

                  --------------------------------------
                  property self, spriteNum, origMember, rolloverMember

                  on mouseEnter
                  self.member=member(rolloverMember)
                  end mouseEnter

                  on mouseLeave
                  self.member=origMember
                  end mouseLeave

                  on beginSprite
                  self=sprite(spriteNum)
                  self.cursor=280
                  origMember=self.member
                  end beginSprite

                  on endSprite
                  self.cursor= -1
                  end endSprite

                  on getPropertyDescriptionList
                  x=[:]
                  x=[#rolloverMember: [#default:" ", #format: #string,
                  #comment: "Name of rollover member "]]
                  return x
                  end getPDL
                  ---------------------------------------------------------

                  (watch out for line-wrap on that x=.... line)

                  HTH

                  Andrew


                  • 6. Re: Quick mouse movement
                    fo_ka Level 1
                    Thank you, everything works fine now....