Loop Exit Help...
Author |
Message |
Leftover
![](http://www.analogwry.com/images/other/loc/leftover.jpg)
|
Posted: Thu Jan 13, 2005 7:08 pm Post subject: Loop Exit Help... |
|
|
Well, here I am again . Working on my final, trying to learn and stay away from here but it's impossible
What I know how to do: Exit a loop by pressing a key and hitting enter, Ex.
code: | loop
Music.PlayFile (%systemroot/whatever/intro.wav)
exit when word = "victory is mine"
end loop
|
which will essentially end the loop when I type in victory is mine... Only problem, it's not exactily what I want it to do, and for me (I'm using it for playing intro theme song for my final) it doesn't stop the music, it waits for it to finish then stops.
What I want to do: Be able to exit the loop and stop the song wherever it is once a menu object is selected with the keyboard and "Enter" is pressed to advance on to the next menu, Ex.
code: | loop
Music.PlayFile (%systemroot/whatever/intro.wav
kill music and exit when keydown = "Enter"
end loop
|
(( Or something like that, I don't know the keydown commands much yet but I'm sure I'll be learning soon ))
If I am attacking this wrong (by using loops or whatever) feel free to shoot me down. Any help is aprecieated and will be put too good use Thanks in advanced, L.O. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Jonny Tight Lips
![](http://www.deftone.com/misc/johnny_tightlips.jpg)
|
Posted: Thu Jan 13, 2005 7:51 pm Post subject: (No subject) |
|
|
You need Music.PlayFileStop and/or Music.SoundOff. Look them up in the turing help file then if you need more help come back. |
|
|
|
|
![](images/spacer.gif) |
Leftover
![](http://www.analogwry.com/images/other/loc/leftover.jpg)
|
Posted: Thu Jan 13, 2005 8:24 pm Post subject: (No subject) |
|
|
Okay I got that far . Using Music.PlayFileLoop instead of the loop then Music.PlayFile, and I know how to kill it with Music.SoundOff, but not sure how to make it do that command when enter, or ascii 10 is pressed. |
|
|
|
|
![](images/spacer.gif) |
Leftover
![](http://www.analogwry.com/images/other/loc/leftover.jpg)
|
Posted: Thu Jan 13, 2005 9:11 pm Post subject: (No subject) |
|
|
Okay I got it from there, thanks Jonny.
I used:
code: |
Music.PlayFile (%systemroot/blah/whatever.wav)
...
loop
if hasch then
move := getchar
if move = chr (10) then
Music.PlayFileStop
end if
end if
end loop
|
|
|
|
|
|
![](images/spacer.gif) |
|
|