Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Music.PlayFile trouble Please help Final Project due tomorrow
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Shainman




PostPosted: Mon Jan 14, 2008 9:01 pm   Post subject: Music.PlayFile trouble Please help Final Project due tomorrow

Hi back again and i seriously need help on this one. I have to make a game for my grade 9 final project, and its due tomorrow. This time my troubles come from Music.PlayFile. heres my code for it

process music
if finished = false then
Music.PlayFile ("Movie Themes - James Bond 007 (Original).mp3")
else
if finished = true then
Music.PlayFileStop
end if
end if
end music
fork music

var finished is set as a boolean and false, and it is called true when my final screen is to appear, however the music doesnt stop, is there any way to make it stop. Please help as soon as u can Thank You Very Happy
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Jan 14, 2008 9:33 pm   Post subject: RE:Music.PlayFile trouble Please help Final Project due tomorrow

you need to step through your logic, there are a couple of mistakes.

1. How often does your program check finished = true line?

2. How long does it take for the Music.PlayFile to execute?
code:

put "starting"
Music.PlayFile ("Movie Themes - James Bond 007 (Original).mp3")
put "done"


Look into Music.PlayFileReturn, loops, and other help topics with similar (actually same) questions.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Shainman




PostPosted: Mon Jan 14, 2008 9:39 pm   Post subject: Re: Music.PlayFile trouble Please help Final Project due tomorrow

the file is about 1:44 in length. and i put finished = true only in one spot, because i only need it to stop at the end of the program
Tony




PostPosted: Mon Jan 14, 2008 9:47 pm   Post subject: RE:Music.PlayFile trouble Please help Final Project due tomorrow

so why not simply
Turing:

procedure music
   Music.PlayFile ("Movie Themes - James Bond 007 (Original).mp3") 
   Music.PlayFileStop
end music
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Shainman




PostPosted: Mon Jan 14, 2008 10:13 pm   Post subject: Re: Music.PlayFile trouble Please help Final Project due tomorrow

it for my final project so when the person presses quit, the user gets a goodbye screen and then the window closes. I need the music to stop when the window closes. anyway to do that?
Tony




PostPosted: Mon Jan 14, 2008 10:41 pm   Post subject: RE:Music.PlayFile trouble Please help Final Project due tomorrow

yes, call Music.PlayFileStop when you want your music to stop.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Shainman




PostPosted: Mon Jan 14, 2008 10:56 pm   Post subject: Re: Music.PlayFile trouble Please help Final Project due tomorrow

Thanks Tony if it wasnt for you i would never get my project done Very Happy Very Happy Very Happy Very Happy Mr. Green
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: