Player seems to miss out alternate filenames on Win XP

Klaus Major klaus at major-k.de
Sun Oct 19 11:01:26 EDT 2003


Hi Stephen,


from the dox about "playstopped":

>  Note:  The playStopped message is sent when a card containing the 
> player
> closes and when the player’s filename property is changed, even if the 
> movie
> or sound is not currently running.

!!! Here are your missing lines...
Everytime you set the new filename the "playstopped" message is sent, 
TOO!!!

> To prevent a playStopped handler from being
> executed inappropriately, set the lockMessages to true before changing 
> the filename or switching cards:
>
>   lock messages -- prevent sending playStopped
>   set the filename of me to newFile
>   unlock messages

So add these 2 lines in your script and see what happens...

See below:

> On PlayStopped
> if PlayingFromList = "false" then
>     set the backgroundcolor of graphic "Indicator" to red
> else
>     put NowPlaying+1 into NowPlaying #NowPlaying starts at 0
>     wait for 500 milliseconds
>     if line NowPlaying of field "Output" = "" then
>         set the backgroundcolor of graphic "Indicator" to red
>         exit PlayStopped
>     end if
>     put "c:/player/Playlist/" & line NowPlaying of field "Output" into 
> field
> "FilePlaying"

lock messages ##!!!

>   set the filename of player "Player1" to field "FilePlaying"

unlock messages ##!!!

>     set the currentTime of player "Player1" to 0
>     start player "Player1"
> end if
> end PlayStopped

Hope that helps...

Have a nice sunday :-)


Regards

Klaus Major
klaus at major-k.de
www.major-k.de



More information about the Use-livecode mailing list