Movie problems in LiveCode
J. Landman Gay
jacque at hyperactivesw.com
Tue Mar 24 15:29:49 EDT 2015
On 3/24/2015 10:26 AM, Richard Gaskin wrote:
> In apps where the media I'm playing resides in a single folder, I often
> just have a central handler cover that to which I pass the file's short
> name only and it takes care of the rest, e.g.:
>
> on PlayMovie pFile
> put specialFolderPath("documents")&"/MyApp/media/"& pFile into tPath
> if there is not a file tPath then
> answer "Media file missing: "& tPath
> exit to top
> end if
> play tPath
> end PlayMovie
That's exactly what I do too, I've never trusted relative paths. I use
this method for all file types, not just movies, but I turn it into a
function so I can call it for any kind of file:
function pathToFile pName
put specialFolderPath("documents")&"/MyApp/media/"& pName into tPath
return tPath
end pathToFile
This works great and is portable everywhere. If there are several
folders involved, I use a switch statement inside the function, or else
pass the folder and file names both in the parameters.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list