Sound and open stack

Klaus Major klaus.major at metascape.org
Wed Sep 11 06:47:21 EDT 2002


Hi James,

> My son is using revolution to build a cd for a class project and wants 
> to
> get an audioclip tp play when the project first opens and then to loop 
> until
> the viewer exits.

try this:

Put this into the card-script of the first card:

on opencard
   global soundisplaying
   if soundisplaying is not "true" then
     play ac "your soundname here" looping
     put "true" into soundisplaying
   end if
end opencard

Maybe the use of the global is not necessary...
I am not sure if a second "play ac ..." will start that
sound from the beginning again, therefore i make
sure in my example that the sound is started only once.

The sound will stop when on quit.

In case it has to be stopped somewhere manually use:

...
play stop ac "your soundname here"
...

In case you want to work with a player-object,
the syntax will be:

on opencard
   global soundisplaying
   if soundisplaying is not "true" then
     set the looping of player "your name of player here" to true
    start player "your name of player here"
     put "true" into soundisplaying
   end if
end opencard

To stop:
...
stop player "your name of player here"
...

If Quicktime is available i would recommend
the use of players...


Hope this helps.


Regards

Klaus Major
klaus.major at metascape.org




More information about the use-livecode mailing list