PDA

View Full Version : Stuck in a loop


fukiyama
04-03-2001, 04:09 PM
Hi, I have a loop that loops background graphics. I would like to play a song over the looping graphics but no matter where I place the sound layer, it always gets stuck in the loop and causes havoc. Any hints on how to hide the sound from the loop and keep it in the same scene. thanks



In response to your reply, sorry but what does MC stand for? I'm not sure if I completely understood the response. What I'm doing is having rain fall (which is a loop of lines dashing from top to bottom) and I want to play a couple of songs during the rainfall. The beginning of the first song gets caught in the loop and uses up all my processing power. Sort of like positive feedback building on stage (in the music world). Anyhow, thanks for your time. Mike

[Edited by fukiyama on 05-24-2001 at 05:14 PM]

Marx
04-03-2001, 05:18 PM
Hi..
Use the sound object and place your sound in it's own MC.

1) In your MC, frame1:

s = new Sound();
s.attachSound("mySound");
s.start(0,10);

The first line creates a sound object, the second attaches a sound from the library and the third starts the sound immediately and loops 10 times.

2) Frame2: Add a stop action.

3) To stop the sound:

on (release) {
s.stop();
}

4) To start again add:

on (release) {
s.start(0,100);
}

When you've finished, go back to your main stage and drag an instance of your sound MC to the stage and drop it in it's own layer.

Hope this helps.

PS: To attach a sound:
a) Select your sound in the library, click the options button and select 'linkage'.
b) Choose 'export this symbol' and type a name for your sound.