set player filename (was:use-revolution digest, Vol 1 #597 - 7 msgs)

Sarah sarahr at genesearch.com.au
Sun Aug 11 22:00:01 CDT 2002


In case some other script has changed the default folder, or the 
application has been closed & opened, I would store the path to your 
audio files folder in a custom property and not rely on the default 
folder.

To modify Kurt's scripts slightly:

on mouseup
   answer folder "Please select a folder containing audio clips."
   set the cAudioFolderPath of this stack to it
   set the defaultfolder to it
   put the files into fld "playList"
end mouseup

on mouseup
   put the cAudioFolderPath of this stack into folderPath
   put the selectedText of me into audioToPlay
   set the currentTime of player "audioPlayer" to 0
   set the filename of player "audioPlayer" to folderPath & "/" & 
audioToPlay
   start player "audioPlayer"
end mouseup

This way you give the complete file path to your player every time, 
regardless of the default folder setting.

Sarah

On Monday, August 12, 2002, at 11:11  am, Kurt Kaufman wrote:

> Here's one way:
>
> script of select music folder button:
>
> on mouseup
> answer folder "Please select a folder containing audio clips."
>   set the defaultfolder to it
>   put the files into fld "playList"
> end mouseup
>
>
> script of list playList (playLists' "listBehavior" and "locktext" must 
> be set to true):
>
> on mouseup
>   put the selectedText of me into audioToPlay
>   set the currentTime of player "audioPlayer" to 0
>   set the filename of player "audioPlayer" to audioToPlay
>   start player "audioPlayer"
> end mouseup
>
> -might want to set player "audioPlayer" 's showController to true.
>
> hope this helps,
> KK
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>





More information about the use-livecode mailing list