Problem with Player Object

Dave dave at looktowindward.com
Mon Jun 18 08:56:34 EDT 2007


Hi All,

I have a simple test stack with a player object and two buttons. One  
button lets you choose a file and the other attempts to step the  
movie by one frame. I have a test movie where there is an image of  
the frame number in the movie frame, number 0 to N. Where N is the  
number of frames in the movie.

If I choose a file and start pressing the "Plus 1" button, all goes  
well until I reach frame frame 22. When I press the button to advance  
to Frame 23, two frames get played and the counters are out of sync  
by 1. This error grows as you step through the file. The frame rate  
of this movie is 25 FPS, which is why I am adding 25 to the frame  
count each time.

Anyone have any idea of what the problem is?

Thanks a lot
All the Best
Dave

Choose Button Script:

on mouseUp
   local myFilePathName

   answer file "Select Movie"
   if it = empty then exit mouseUp
   put it into myFilePathName

   put 0 into field 1
   put 0 into field 2

   set fileName of player 1 to myFilePathName
   set the playSelection of player 1 to true

   set the startTime of player 1 to 0
   set the endTime of player 1 to 1
   start player 1

   set the cpStackCurrentMovieTime of this stack to -25
end mouseUp

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

Plus 1 Button script:

on mouseUp
   local myCurrentTime
   local myTimeScale

   put the timeScale of player 1 into myTimeScale

   put the cpStackCurrentMovieTime of this stack into myCurrentTime
   add 25 to myCurrentTime
   set the startTime of player 1 to myCurrentTime
   set the endTime of player 1 to (myCurrentTime + 1)


   set the cpStackCurrentMovieTime of this stack to myCurrentTime

   start player 1

   put myCurrentTime into field 1
   put myCurrentTime / 25 into field 2

end mouseUp



More information about the use-livecode mailing list