4 Replies Latest reply on Jul 27, 2006 1:00 PM by Newsgroup_User

    Customized Controls

    Will Hudson
      I am working on a project where I need to play, pause, and stop a narration. I know Director has built in actions to do these, but I have to get a bit more complicated. I need to set it up where mouse overs and mouse clicks will change the buttons and make them more interactive. So I need it to act like a normal control panel you would see in media player or similar programs. If anyone could help me out here it would be much appreciated.
      Thanks
        • 1. Re: Customized Controls
          Level 7
          There are also behaviors in the Library for that sort of thing. Look at
          the behaviors in the Animation - Interactive section of the Library.

          Or were you looking for information on how build the different states
          for the button controls?

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: Customized Controls
            James Newton, ACP Level 3
            You can find a demo movie with behaviors which do more or less what you ask for at http://nonlinear.openspark.com/tips/sound/panvolume/.

            When you rollover the play button, the mouse cursor changes to a finger. When you click on the button, it toggles between Pause and Play icons.
            • 3. Re: Customized Controls
              Will Hudson Level 1
              Im looking for information on how to build them from nothing. I do have a bit completed, but it's been a total pain.

              property pCount
              property spriteNum
              property mySprite
              property myStandardMember
              property myRolloverMember

              on beginSprite
              pCount = 0
              mySprite = sprite(spriteNum)
              myStandardMember = mySprite.member
              myRolloverMember = 164
              end

              on mouseDown
              if pCount = 0 then
              pause
              mySprite.member = myRolloverMember
              pCount = +1

              else
              continue
              mySprite.member = myStandardMember
              pCount = 0
              end if
              end

              on mouseEnter
              mySprite.member = myRolloverMember
              end mouseEnter

              on mouseLeave
              mySprite.member = myStandardMember
              end mouseLeave

              Now i need to figure out how to make the stop and play buttons interact with eachother along with intereacting with this pause button.
              • 4. Re: Customized Controls
                Level 7
                To get what you want, you need to have three different cast members for
                each button sprite. One for the "normal" state, one for the "rollover"
                state, and a third for the "in use" state.

                You also need to relate each of the buttons to the others.

                Here's a very simple way to achieve that. you can use this behavior as
                the basis for each button. You'll then have to make two new copies so
                that each behavior only does the action that you want that one button to
                do.

                ---------
                global spriteList
                property thisSprite
                property normalMember
                property overMember
                property downMember
                property inUse

                on getPropertyDescriptionList
                myPropList = [:]
                myPropList.addProp(#overMember,[#comment:"pick the member for the over
                state of this sprite:",#format:#bitmap,#default:""])
                myPropList.addProp(#downMember,[#comment:"pick the member for the in
                use state of this sprite:",#format:#bitmap,#default:""])
                return myPropList
                end

                on beginSprite me
                thisSprite = me.spriteNum
                normalMember = sprite(thisSprite).member.name
                inUse = false
                if spriteList = VOID then spriteList = []
                if not spriteList.getOne(thisSprite) then
                spriteList.add(thisSprite)
                end if
                end

                on endSprite me
                if not spriteList = VOID then spriteList = VOID
                end

                on mouseEnter me
                if not inUse then
                sprite(thisSprite).member = overMember
                end if
                end

                on mouseLeave me
                if not inUse then
                sprite(thisSprite).member = normalMember
                end if
                end

                on mouseDown me
                sprite(thisSprite).member = downMember
                end

                on mouseUp me
                if not inUse then
                inUse = true
                repeat with n = 1 to spriteList.count
                if spriteList[n] <> thisSprite then
                sprite(spriteList[n]).inUse = false
                sprite(spriteList[n]).member = sprite(spriteList[n]).normalMember
                end if
                end repeat
                end if
                -- do the actual thing that needs to be done
                end

                on mouseUpOutside me
                if not inUse then
                sprite(thisSprite).member = normalMember
                end if
                end

                --
                Rob
                _______
                Rob Dillon
                Adobe Community Expert
                http://www.ddg-designs.com
                412-243-9119

                http://www.macromedia.com/software/trial/