7 Replies Latest reply on Feb 25, 2007 2:35 AM by nevereasy

    hyperlink in html in lingo

    nevereasy
      My program is a series of movies that the user jumps between. Each movie puts its own name and file name into a list and this data is used to track a user's progress. It is a long list of short lists. The attached code does a great job using html to display a table. However, I want one of the words in the list to be a hyperlink and to link back to the movie that generated it. It only has to go to another movie that is in the same folder.

      Please can you have a look at this and suggest why it might not work. or better still, suggest a method that will work!

      thanks,
      cjj

      ------------------------------------------------------------------------------------------ ---------------------------------------
        • 1. Re: hyperlink in html in lingo
          Level 7
          nevereasy wrote:
          > My program is a series of movies that the user jumps between. Each
          > movie puts its own name and file name into a list and this data is
          > used to track a user's progress. It is a long list of short lists.
          > The attached code does a great job using html to display a table.
          > However, I want one of the words in the list to be a hyperlink and to
          > link back to the movie that generated it. It only has to go to
          > another movie that is in the same folder.

          Do you have an on hyperlinkClicked handler? (Look in the help for an
          example.)

          Andrew


          • 2. hyperlink in html in lingo
            James Newton, ACP Level 3
            1) Open the Library Palette (menu item Window | Library Palette)
            2) Use the castLib selection popup to display the Text palette
            3) Locate Chris Walcott's "HyperText - General" behavior
            4) Drag it onto your text sprite
            5) Replace the viewUserProgress() handler in your script with the two handlers below
            6) Run the movie and test


            • 3. Re: hyperlink in html in lingo
              nevereasy Level 1
              Dear openspark,
              you really are a bright one! thanks for this solution.

              Now I have another problem. Of my first 10 files that I am linking to with this code only 2 work without an error message. When I try to open the script or the debug button from the error meassage window, nothing happens, the newly opened movie just stops running.

              With these 8 movies, there are 4 different error messages, so I am assuming the error is in the destination movie, but I can't understand why it won't open the script or debug window.

              The error messages are:

              Scrip error: Cast member not found
              theMember.char[range[1]].hyperlinkState = #visited

              -- this error occurs when the movie links back to itself. I have tried this
              to try to find out what is wrong.
              -------------------------------------------------------------------------------------

              script error: Handler not found in object
              return \
              [ \
              #myBuiltInCursor: \
              #format: #cursor, \
              #default: 280\
              ]\
              ]

              #getPropRef

              ------------------------------------------------------------------------------

              Script error: Handler not found in object

              end

              #getPropRef

              ---------------------------------------------------------------------------------

              Script error: Cast member not found

              end

              ----------------------------------------------------------------------------------

              Can anyone see anything that all these errors have in common ...
              or maybe each movie has a different problem ...

              without the debug window, I don't know where to start.

              I have searched the scripts, but these references are to director behaviors that are the same in every movie, even the ones that work. ...

              any ideas???

              thanks
              cjj


              • 4. Re: hyperlink in html in lingo
                nevereasy Level 1
                Another error message that I am getting when I click on one of the links made in this code is:

                --------------------------------------------------------------
                Script error: Property not found.

                #hyperlink State
                --------------------------------------------------------------

                as ususal, I can't open the debug window.

                In addition, I've just noticed that the scroll bar of the original movie is still in view when these error messages appear in front of the destination movie. No matter whether I click on 'debug', 'script' or 'cancel', the destination movie just stops, and neither of the windows open.

                really appreciate any help.

                thanks
                cjj
                • 5. Re: hyperlink in html in lingo
                  nevereasy Level 1
                  I would be happy if anyone could guess!!!!
                  • 6. Re: hyperlink in html in lingo
                    James Newton, ACP Level 3
                    I know of two circumstances when you can't open the Debug window:

                    1) When the code that is executing is in a script which is no longer in the current movie.
                    2) When the code is compiled on-the-fly from text.

                    An example of (1): You create a script instance and place it on the actorList. You then travel to a movie where the initial script is absent. The instance's stepFrame handler hits a bug. The Debugger will think that the error is due to some line of code that it finds in the new movie, so its alert may be singularly unhelpful.

                    Workaround: place the script in an external cast which is shared by all the movies that you plan to visit. Make sure that this external cast has the same castLib.number in all movies.

                    An example of (2):

                    the mouseDownScript = "provokeError"

                    Run your movie and click. You won't be given the option of opening the Debugger window.


                    My guess is that you are running into the second scenario, because you are trying to execute code stored as text in a hyperlink. I'd guess further and say that you should check that gProgList[aIndex][3] is a valid movie name for all values of aIndex.
                    • 7. Re: hyperlink in html in lingo
                      nevereasy Level 1
                      It works! I found a line of code that referred to the state of the link once it had been visited. This is not needed in my movie so I commented it out. I found this by putting the suspect codes into external cast and and linkging it to a destination movie. then I was able to open the debug window.

                      Now, all working very well. Thank you so much.