1 Reply Latest reply on Aug 24, 2006 8:21 AM by Newsgroup_User

    randomly jump to markers

    SimonBaum
      hi

      i'd like to know how i can randomly jump to a list of markers with and without repetition.

      thanks a lot for your answer!

      simon
        • 1. Re: randomly jump to markers
          Level 7
          With repetition you can just jump to a random spot within the markerList:

          newMarker = _movie.markerList[random(_movie.markerList.count)]
          _movie.go(newMarker)

          Without repetition you'd use the standard method of randomly pulling entries
          from one list and adding them to another:

          on randomizeMarkers
          m = _movie.markerList.duplicate()
          n = []
          c = m.count
          repeat with cnt = c down to 1
          i = random(m.count)
          n.add(m )
          m.deleteAt(i)
          end repeat
          return n
          end

          randomMarkers = randomizeMarkers()

          Then you can simply iterate randomMarkers to jump around randomly without
          repition.


          HTH


          --
          Dave -
          Adobe Community Expert
          www.blurredistinction.com
          http://www.adobe.com/communities/experts/