6 Replies Latest reply on Sep 5, 2006 5:30 PM by Newsgroup_User

    Adding Links to Scrollable Text

    andyulrika_is_back Level 1
      Hello

      I would like to add a link from words in scrollable text which jump to a marker within the score. Could someone please help.

      Thanks in advance

      Andy
        • 1. Re: Adding Links to Scrollable Text
          Level 7
          Add hyperlinks to chunks using the Text Inspector. Add a behavior to the
          text sprite that catches the #hyperlinkClicked event and responds by
          navigating to the marker name defined in the hyperlink (and passed to
          the handler when you click it):
          --
          on hyperlinkClicked me, tData, tRange
          go to tData
          end
          • 2. Re: Adding Links to Scrollable Text
            andyulrika_is_back Level 1
            Hi Sean

            Thanks for responding to my question. Any chance you could elaborate on your code a little, I'm no lingo expert and find it difficult to implement what you said.

            Thanks again.

            Andy
            • 3. Re: Adding Links to Scrollable Text
              Level 7
              > Any chance you could elaborate on your code a little

              Copy and paste it into a behavior and attach the behavior to your text
              sprite. Use the Text Inspector to create hyperlinks in your text member
              • 4. Re: Adding Links to Scrollable Text
                andyulrika_is_back Level 1
                Hi Sean

                Many thanks for your help. The strangest thing happens and I can't understand why! I've created a paragraph of text - highlighted a word, entered into the Text Inspector hyperlink area. Added your behaviour to the text member and when I click on the link it displays the page I am sending it to for a fraction of the second then the play head returns to the original location???

                Any ideas what I've done wrong? Or is there something blatently obvious I've missed.

                Help much appreciated.

                regards

                Andy
                • 5. Re: Adding Links to Scrollable Text
                  Level 7
                  That's odd. I just created a bare-bones movie and can't reproduce that -
                  it's goes to the frame defined in the hyperlink and stays there. Are
                  there any other behaviors attached to the text sprite, or only the code
                  I posted?
                  You could try turing on the trace function to see what other code is
                  executed. The down-sdie is that your message window will get swamped and
                  trying to narrow down to the useful parts can be tricky:
                  --
                  on hyperlinkClicked me, tData, tRange
                  the trace = 1
                  go to tData
                  end
                  • 6. Re: Adding Links to Scrollable Text
                    Level 7
                    On Tue, 05 Sep 2006 21:09:31 GMT, andyulrika posted in
                    macromedia.director.lingo:

                    > Hi Sean
                    >
                    > Many thanks for your help. The strangest thing happens and I can't
                    > understand why! I've created a paragraph of text - highlighted a word,
                    > entered into the Text Inspector hyperlink area. Added your behaviour to
                    > the text member and when I click on the link it displays the page I am
                    > sending it to for a fraction of the second then the play head returns
                    > to the original location???
                    >
                    > Any ideas what I've done wrong? Or is there something blatently obvious
                    > I've missed.

                    I'm guessing that the *frame* you're going to doesn't have anything to
                    keep the playback head there. In authoring mode, by default, Director will
                    loop back to the beginning.

                    Try adding this behavior to the behavior script channel:

                    on exitFrame me
                    go the frame
                    end

                    Also, be sure to add Sean's behavior to the sprite - not to the text
                    member. If you have a script on the text member in the castLib, delete it.


                    --
                    Mark A. Boyd
                    Keep-On-Learnin' :)