2 Replies Latest reply on Nov 5, 2011 6:27 AM by threni

    3D arrays

    threni Level 1

      I am trying to implement a simple 3d array in lingo to make a transition matrix. Brendan Young's article long ago

      http://www.director-online.com/buildArticle.php?id=343  is an easy way to do it, but I have trouble using the methods involved. I am using 11.5, which is newer than the version Young wrote his article for no doubt,but i cant see why there would be a difference in such a simple script. Perhaps 11.5 uses lists differently? At any rate, I would appreciate someone letting me know of a simple way to make such an array, or anyone who has some experience with this article.

        • 1. Re: 3D arrays
          Mister MUX Level 2

          A 2-diminsional array in Director is really just a linear list, where each element in the list is another linear list. For example


          if myarray = [[1,2,3],[4,5,6]]


          myarray[1][1] is 1

          myarray[2][3] is 6.


          A 3-dimensional array just takes this a step further, ie a list of lists of lists.


          if myarray = [[[1,2,3],[4,5,6],[7,8,9]],[[11,22,33],[44,55,66],[77,88,99]],[[111,222,333],[444,555,666 ],[777,888,999]]]


          myarray1][1][1] is 1

          myarray[2][2][1] is 44

          myarray[3][3][2] is 888


          Is that what you are trying to understand?

          1 person found this helpful
          • 2. Re: 3D arrays
            threni Level 1

            Thank you for your reply. I have settled on this solution- my question was badly formed, and compounded several other questions concerning getting the array to work as a parent script as Young's old script did.