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

#1 2007-10-12 18:41:27

acevipa
Scratcher
Registered: 2007-10-09
Posts: 17

How to get music playing once the scratch file is opened

I want song to play as soon as the scratch file is opened (or in other terms once a certain costume appears). Note, that I do not want the music to stop and restart once that costume appears again. I want the music to continuously play and repeat itself forever. How can I do that???

Offline

 

#2 2007-10-12 18:47:38

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: How to get music playing once the scratch file is opened

To start song right away:
when green flag
    forever
        play song and wait


To start song later:
when green flag
   set playing to 0
   wait until playing > 0
   forever
       play song and wait

To start the music, set playing to 1.
With this code, there is no way to stop and restart the music, since  that is what you requested.

Offline

 

#3 2007-10-12 18:53:50

acevipa
Scratcher
Registered: 2007-10-09
Posts: 17

Re: How to get music playing once the scratch file is opened

kevin_karplus wrote:

To start song right away:
when green flag
    forever
        play song and wait


To start song later:
when green flag
   set playing to 0
   wait until playing > 0
   forever
       play song and wait

To start the music, set playing to 1.
With this code, there is no way to stop and restart the music, since  that is what you requested.

Yes, though my program has not been set so that when the green flag is pressed start. I have set it using keys.

Offline

 

Board footer