4 Replies Latest reply on May 30, 2007 6:13 AM by James Newton, ACP

    Confused!!!

    JoemcM
      on Home
      go to frame("105")
      end

      The above code - linked to a flash nav bar will get me to frame 105
      The stuff below was generated usng the go to frame x btton from the code library - searched but cant ind the value "105" how does it find the frame?

      -- DESCRIPTION --

      on getBehaviorDescription me
      return \
      "GO TO FRAME X" & RETURN & RETURN & \
      "Moves the playback head to the chosen frame when the user clicks on the sprite" & RETURN & RETURN & \
      "PERMITTED MEMBER TYPES:" & RETURN & \
      "Graphic members" & RETURN & RETURN & \
      "PARAMETERS:" & RETURN & \
      "* Go to which frame on mouseUp?"
      end getBehaviorDescription


      on getBehaviorTooltip me
      return \
      "Use with graphic members. " & \
      "Moves the playback head to the specified frame on mouseUp."
      end getBehaviorTooltip



      -- HISTORY --

      -- 3 November 1998, written for the D7 Behaviors Palette by James Newton
      -- 5 January 2000: updated to D8 <km>



      property myTargetFrame


      on mouseUp me
      go myTargetFrame
      end mouseUp



      on isOKToAttach (me, aSpriteType, aSpriteNum)

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

      return(tIsOK)
      end on



      on getPropertyDescriptionList me
      return \
      [ \
      #myTargetFrame: \
      [ \
      #comment: "Go to which frame on mouseUp?", \
      #format: #integer, \
      #default: the frame \
      ] \
      ]
      end getPropertyDescriptionList

      Text
        • 1. Re: Confused!!!
          johnAq Level 1
          When navigating to a frame, you should use an integer

          go to frame(105) --no quotes

          if you use a string ("105") Director will look for a label/marker called 105

          hth

          johnAq
          • 2. Re: Confused!!!
            MECS
            Why the parenthesis? Wouldn't go to frame 105 work just as well?
            • 3. Re: Confused!!!
              Level 7
              Why the 'to frame'? We can condense it down to

              go 105
              • 4. Re: Confused!!!
                James Newton, ACP Level 3
                quote:

                Originally posted by: JoemcM
                The stuff below was generated usng the go to frame x btton from the code library - searched but cant ind the value "105" how does it find the frame?

                on getPropertyDescriptionList me
                return \
                [ \
                #myTargetFrame: \
                [ \
                #comment: "Go to which frame on mouseUp?", \
                #format: #integer, \
                #default: the frame \
                ] \
                ]
                end getPropertyDescriptionList

                Text



                When you drop the behavior on a sprite, a Behavior Parameters Dialog opens. This allows you to enter the data defined in the "on getPropertyDescriptionList()" handler. The data is then stored as part of the Score. You can retrieve this data via Lingo by using:

                put sprite(<spriteNum>).scriptList
                -- [[(member x of castLib y), "[#myTargetFrame: 105]"]]

                To change it from within the Director authoring environment:
                1. Select the sprite
                2. Open the Property Inspector at the Behavior tab
                3. Click on the Cog icon, or double-click on the Go To Frame X behavior name
                4. The Behavior Parameters Dialog will re-open
                5. Enter the new value

                Rather than using the Go To Frame X behavior to jump to a particular frame number, I recommend using named markers. If you create a marker in the Score window, then add or delete frames for any reason, the marker will move with the existing sprites. The frame number for those sprites will change. Below is a simple behavior that allows you to choose a marker to jump to. You can find a more sophisticated Go Marker Button behavior in the movies at http://nonlinear.openspark.com/tips/navigation/history/