1 Reply Latest reply on Nov 30, 2007 11:31 AM by Newsgroup_User

    Lists and variables, Help

    bobthree Level 1
      Greetings everyone. I am having a little problem with using lists and variables. I have a digital report with 8 buttons at the top that creates a list with the first member being the identifier for that location.

      on mouseUp me
      set navList=["A"]
      go to "Interupt"
      end

      All eight buttons send the head to the same marker and runs a special transition, words fading, lines moving etc. at the end of the transition a new linked movie is opened depending on the value of the first member in the list.

      on exitFrame me
      if navList[1]="A" go to frame "Start" of movie "M_A"
      if navList[1]="B" go to frame "Start" of movie "M_B"
      if navList[1]="C" go to frame "Start" of movie "M_C"
      if navList[1]="D" go to frame "Start" of movie "M_D"
      if navList[1]="E" go to frame "Start" of movie "M_E"
      if navList[1]="F" go to frame "Start" of movie "M_F"
      if navlist[1]="G" go to frame "Start" of movie "M_G"
      if navList[1]="H" go to frame "Start" of movie "M_H"
      end

      The problem that I have is when I go to compile the script above it comes back with "variable used before assigned a value" . Maybe I do not know how to use a list properly. What am I doing wrong? Any help or hint of help would be much appreciated.
        • 1. Re: Lists and variables, Help
          Level 7
          You just need to declare the variable as a global. You would enter this
          at the top of any script window that needs to use the navList variable:

          global navList

          For example, your script on the buttons would look like this:

          global navList

          on mouseUp me
          set navList=["A"]
          go to "Interupt"
          end

          And you would also put that on the exitFrame script that controls which
          movie opens. If you declare it as global, than any scriupt that also
          declares it as global will be able to use the contents of the variable.

          -Mike