labelText

  how to find the text of the last marker passed
marker label




  labelText
>.... for me this one works fine:
>
>on findLastLabel me
>  repeat with i = 1 to the number of lines in the labelList
>    if the frame < label(line i of the labelList) then
>      return line i - 1 of the labelList
>    end if
>  end repeat
>  return line (the number of lines in the labelList - 1) of the labelList
>end
>
>Any better ideas?
>

Depending on the number of markers/labels and how oftne you call this handler 
it may possibly slow your code down. I call the handler below in the startmovie
 and after that retrieve the text of the most recent label by 

set dLabeltxt = getaprop(glplabels,marker(0))

The difference is quite dramatic, testing 10000 iterations of both methods on 
the last frame of a movie with 1661 frames and 109 markers took  53883 ticks 
with findLastLabel and 47 ticks with my alternative. 

(dfw 6.02 cyrix p166+ nt4)


on listLabels
  --sorgt dafür, daß man mit "put getaprop(glplabels,marker(0))" 
  --den Text des aktuellen Labels abfragen kann
  global gLpLabels
  set gLplabels=[:]
  repeat with i = 1 to the number of lines in the labellist
    addprop gLpLabels,label(line i of the labellist),line i of the labellist
  end repeat
end

Home shock + cgi Bits 'n pieces Director Lingo Shocklets Contact










pageID=l_labelText