3 Replies Latest reply on Nov 8, 2006 2:07 AM by duckets

    Fireworks HTML Components in Director Help

    djDaemon
      I have an interactive manual that I am creating in Director. My design process has me creating the elements in Fireworks, and importing them (HTML) into Director. I have created the main menu bar, along with the appropriate multi-state buttons. In Director, clicking on one of those buttons ("Safety", for instance) puts it into a toggled state, and sends the user to a marker where a sub-menu is displayed, with the additional choices for that main-menu ("Safety") choice.

      At this point, if the user selects one of those sub-menu choices, the "Safety" main menu button toggles back to off. This is not the desired behavior, as I would like the "Safety" button to remain toggled for the duration of the time that the user is within the "Safety" section. I would like to avoid having to overlay a toggled image, as I would like to keep the solution more elegant, so to speak.

      Any help would be greatly appreciated. Thanks in advance!

      - dj
        • 1. Re: Fireworks HTML Components in Director Help
          Level 7
          Can you share the code that you're using for these buttons?

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

          http://www.macromedia.com/software/trial/
          • 2. Re: Fireworks HTML Components in Director Help
            djDaemon Level 1
            -- DESCRIPTION --

            on getBehaviorDescription me
            return \
            "MULTISTATE TOGGLE BUTTON"
            end getBehaviorDescription


            on getBehaviorTooltip me
            return \
            "Create an ON/OFF button which reacts to rollovers and clicks. " & \
            "Use several such buttons together as a radio button group."
            end getBehaviorTooltip
            -- HISTORY-- 5 March 2000: Modified to match Fireworks button order
            -- and be D7 and D8 compatible for Fireworks Importer <jba>
            -- PROPERTIES --

            property spriteNum
            property mySprite
            -- author-defined parameters
            property myOffMember
            property myOffOverMember
            property myOffDownMember
            property myOffCommand
            property myOnMember
            property myOnOverMember
            property myOnDownMember
            property myOnCommand
            -- internal properties
            property theMouseWasUp
            property myRollover
            property myState -- TRUE | FALSE: max one button in group TRUE at one time
            -- shared properties
            property ourID -- string common to all buttons in a group
            property ourGroupList -- list of behaviors in the group
            property ourMouseDown -- list indicating if the clickOn is in the group



            -- EVENT HANDLERS --

            on beginSprite me
            if myOffOverMember = 0 then
            theMemberNum = sprite(the currentSpriteNum).member.number
            myOffMember = member (theMemberNum)
            myOffOverMember = member (theMemberNum+1)
            myOffDownMember = member (theMemberNum+2)
            myOnMember = member (theMemberNum+2)
            myOnOverMember = member (theMemberNum+3)
            myOnDownMember = member (theMemberNum+3)
            ourID = ""
            myOnCommand = "sendAllSprites #Toggle_On, the currentSpriteNum"
            myOffCommand = "sendAllSprites #Toggle_Off, the currentSpriteNum"
            end if
            Initialize me
            end beginSprite


            on prepareFrame me
            CheckForRollover me
            end prepareFrame


            on mouseDown me
            ClickOn me
            end mouseDown


            on mouseUp me
            if ourMouseDown[1] then Toggle me
            end mouseUp


            on mouseUpOutside me
            CheckGroupForClick me
            end mouseUpOutside


            -- CUSTOM HANDLERS --

            on Initialize me -- sent by beginSprite
            mySprite = sprite(me.spriteNum)
            ourGroupList = []

            -- Insurance: properties are indeed #members
            myOffMember = member (myOffMember)
            myOffOverMember = member (myOffOverMember)
            myOffDownMember = member (myOffDownMember)
            myOnMember = member (myOnMember)
            myOnOverMember = member (myOnOverMember)
            myOnDownMember = member (myOnDownMember)

            sendAllSprites (#ToggleButton_GroupRollCall, ourID, ourGroupList)
            call (#ToggleButton_MouseDownList, ourGroupList, [FALSE])
            end Initialize



            on CheckForRollover me -- sent by prepareFrame
            mouseOverMe = (the rollover = me.spriteNum)
            if myRollover = mouseOverMe then
            if theMouseWasUp = the mouseUp then
            exit -- Nothing has changed

            else
            theMouseWasUp = the mouseUp
            if mouseOverMe then
            if the mouseUp then
            -- Mouse was clicked elsewhere then dragged and released over button
            case myState of
            TRUE: mySprite.member = myOnOverMember
            FALSE: mySprite.member = myOffOverMember
            end case
            end if
            end if
            end if
            else

            set myRollover to mouseOverMe
            if ourMouseDown[1] then
            if myRollover then
            case myState of
            TRUE: mySprite.member = myOnDownMember
            FALSE: mySprite.member = myOffDownMember
            end case
            else
            -- Indicate that mouseUpOutside will have no effect
            case myState of
            TRUE: mySprite.member = myOnMember
            FALSE: mySprite.member = myOffMember
            end case
            end if
            else
            if not the mouseDown and myRollover then
            case myState of
            TRUE: mySprite.member = myOnOverMember
            FALSE: mySprite.member = myOffOverMember
            end case
            else
            -- No reaction if mouse was clicked elsewhere and dragged to button
            case myState of
            TRUE: mySprite.member = myOnMember
            FALSE: mySprite.member = myOffMember
            end case
            end if
            end if
            end if
            end CheckForRollover



            on ClickOn me -- sent by mouseDown, CheckForRollover
            ourMouseDown[1] = TRUE
            case myState of
            TRUE: mySprite.member = myOnDownMember
            FALSE: mySprite.member = myOffDownMember
            end case
            end ClickOn



            on Toggle me, whichState -- sent by mouseUp, ToggleButton_Off
            if voidP (whichState) then
            myState = not myState
            else
            myState = whichState
            end if
            ourMouseDown[1] = FALSE
            theMouseWasUp = TRUE
            case myState of
            TRUE:
            mySprite.member = myOnMember
            updateStage
            do myOnCommand
            FALSE:
            mySprite.member = myOffMember
            updateStage
            do myOffCommand
            end case
            if ourGroupList.count() then
            if myState then
            call (#ToggleButton_Off, ourGroupList, me)
            end if
            end if
            end Toggle



            on CheckGroupForClick me -- sent by mouseUpOutside
            groupRollover = call (#ToggleButton_Rollover, ourGroupList, [])
            if not groupRollover.count() then
            ourMouseDown[1] = FALSE
            end if
            end Disactivate



            -- PUBLIC METHODS (responses to #sendSprite, #sendAllSprites, #call) --

            on ToggleButton_GroupRollCall me, groupID, groupList
            -- sent by each new button that joins the group
            if groupID = ourID then
            ourGroupList = groupList
            ourGroupList.append(me)
            end if
            return groupList
            end ToggleButton_GroupRollCall


            on ToggleButton_MouseDownList me, mouseDownList
            ourMouseDown = mouseDownList
            end ToggleButton_MouseDownList


            on ToggleButton_Rollover me, theList
            if the rollover = me.spriteNum then
            theList.append(me.spriteNum)
            end if
            return theList
            end ToggleButton_Rollover


            on ToggleButton_Off me, callingBehavior
            -- sent when the member of the group which is toggled ON
            if callingBehavior = me then exit

            Toggle me, FALSE
            end ToggleButton_Off


            on ToggleButton_State me, groupID, statesList
            if not voidP (groupID) then
            if groupID <> ourID then exit
            end if

            case ilk (statesList) of
            #void: return myState
            #list:
            statesList.append(myState)
            #propList:
            statesList.addProp(me.spriteNum, myState)
            end case
            return statesList
            end ToggleButton_State


            on ToggleButton_ActiveButton me, groupID, theList
            if not voidP (groupID) then
            if groupID <> ourID then exit
            end if

            if not listP (theList) then
            theList = [:]
            end if
            if not theList.count() and myState then
            theList.addProp (#sprite, me.spriteNum)
            theList.addProp (#behavior, me)
            end if
            return theList
            end ToggleButton_ActiveButton




            on isOKToAttach (me, aSpriteType, aSpriteNum)

            tIsOK = 0
            if aSpriteType = #graphic then
            tIsOK = 1
            end if

            return(tIsOK)
            end on



            -- AUTHOR-DEFINED PARAMETERS --

            on getPropertyDescriptionList me

            theMember = sprite(the currentSpriteNum).member
            theMemberNum = theMember.number

            return \
            [ \
            #myOffMember: \
            [ \
            #comment: "-OFF STATE- Standard member:", \
            #format: #graphic, \
            #default: theMember \
            ], \
            #myOffOverMember: \
            [ \
            #comment: "Rollover member", \
            #format: #graphic, \
            #default: member (theMemberNum + 1) \
            ], \
            #myOffDownMember: \
            [ \
            #comment: "MouseDown member", \
            #format: #graphic, \
            #default: member (theMemberNum + 2) \
            ], \
            #myOnMember: \
            [ \
            #comment: "-ON STATE- Standard member", \
            #format: #graphic, \
            #default: member (theMemberNum + 2) \
            ], \
            #myOnOverMember: \
            [ \
            #comment: "Rollover member", \
            #format: #graphic, \
            #default: member (theMemberNum + 3) \
            ], \
            #myOnDownMember: \
            [ \
            #comment: "MouseDown member", \
            #format: #graphic, \
            #default: member (theMemberNum + 3) \
            ], \
            #myOnCommand: \
            [ \
            #comment: "-COMMAND SENT- when switched ON", \
            #format: #string, \
            #default: "sendAllSprites #Toggle_On, the currentSpriteNum" \
            ], \
            #myOffCommand: \
            [ \
            #comment: "when switched OFF", \
            #format: #string, \
            #default: "sendAllSprites #Toggle_Off, the currentSpriteNum" \
            ], \
            #ourID: \
            [ \
            #comment: "ID string for the group", \
            #format: #string, \
            #default: "" \
            ] \
            ]
            end getPropertyDescriptionList

            • 3. Re: Fireworks HTML Components in Director Help
              duckets Level 1
              How about removing the 'toggle' behaviour from your sprite on the sub-menu frames?... (if your main menu button is one long sprite, you might need to split it, so you can remove the behaviour from just the sub-menu frames).

              hope this helps!

              - Ben