This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-07-13 07:45:32

xGluttony
Scratcher
Registered: 2011-05-03
Posts: 25

Music/Song Repeating

I need help on how to repeat your songs! OK! I was making a game that have a music, and a play button. but i need help on how to stop the song when i click the button. [When flag clicked][Play sound (blahblah) until done] but if i click the play button i want it to stop and i want the song to go on repeadly until i click the play button so pls help! REPLY ASAP


http://i55.tinypic.com/2mcx6x5_th.jpg

Offline

 

#2 2011-07-13 10:27:05

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Music/Song Repeating

Make a variable called "play" that is set to 1 when you click the play button, then make this script:

Code:

When green flag clicked
set play to 0
repeat until <play = 1>
    play sound [song] until done

Hope that helps!


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-07-14 03:43:30

xGluttony
Scratcher
Registered: 2011-05-03
Posts: 25

Re: Music/Song Repeating

Thanks i will try that!


http://i55.tinypic.com/2mcx6x5_th.jpg

Offline

 

#4 2011-07-14 03:48:57

xGluttony
Scratcher
Registered: 2011-05-03
Posts: 25

Re: Music/Song Repeating

But when i click the play button it still plays


http://i55.tinypic.com/2mcx6x5_th.jpg

Offline

 

Board footer