Standalone application problem
J. Landman Gay
jacque at hyperactivesw.com
Thu Apr 19 12:29:08 EDT 2007
Andrew Lian -nswc wrote:
> Dear All
>
> Please forgive yet another newbie question.
>
> I have stack which plays a sound file played through a playerobject. Its
> path is identified in the player's "Source" property. Let's say it is
> C:/sounds/apl.wav.
>
> The file plays perfectly well in the development environment and on my
> computer.
>
> I now make a standalone application - and it is produced ok. However, my
> sound file can no longer be heard. Either it has not been automatically
> packaged into the application or there is a path problem.
>
> I have tried to include the relevant file in the package by using the
> "Copy Files" setting of the "Standalone application settings" but that
> seems to make no difference. Is there some legible documentation
> somewhere of how to prepare the files so that the whole package gets
> produced correctly with the correct paths? DO I have to respect the
> original paths and recreate them on any computer which tries to run the
> standalone?
This is almost certainly a file path problem. If you are refering to the
sound file by a long file path name, it will not be the same on anyone
else's machine. And if you build a standalone with the file added to the
standalone folder, then its file path will also have changed.
You can solve the problem in a couple of ways. The easiest way is to
calculate the correct file path with a script. Something like this
should work:
put the effective filename of this stack into tPath
set the itemdelimiter to slash
put "mySoundFolder/mySoundFile.aif" into last item of tPath
This will produce a file path to a file named "mySoundFile.aif" inside a
folder called "mySoundFolder" which is next to the standalone. On
Windows, that would be a folder in the same parent folder as your
standalone. On OS X, it would be a folder inside the Mac OS folder which
is inside the application bundle.
Note that inside the IDE, it won't work until you move a copy of the
sound file folder into the same parent folder as your stack.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list