Skip to main content
Participant
July 14, 2006
Answered

Song loop from particular time

  • July 14, 2006
  • 1 reply
  • 150 views
Ok,

I think this is something easy, but I dont know what to use.

I got a song that I cut at 54.4 sec and after the first complete play I want this song to loop from 11.95 sec to the end!
Is there a way using action script or using a movie clip with the song inside(cause I tried to put a gotoandplay to a particular frame at the end, but it begin the song from the beginning)

thanks a lot in advance
This topic has been closed for replies.
Correct answer
Use the Sound class. Let's say your song is named mysong.mp3. Once you import it into your library, select the icon in the library, and choose linkage (right click on the icon) and then click Export for ActionScript and Export in first frame. Name it something (for this example we'll name it mysong). Click OK.

Then on your main timeline, enter the following code:

my_sound = new Sound();
my_sound.attachSound("mysong");
my_sound.onSoundComplete = function() {
// first parameter is the number of seconds the sound is offset, the second parameter is the number of loops
my_sound.start(11.95, 99);
};

When you want to start the sound the first time, add this to your frame or button code:
my_sound.start();

Study the other methods and properties of the Sound class. This gives you a lot more control of sounds than placing them on the timeline does.

Good luck,

Albee

1 reply

Correct answer
July 14, 2006
Use the Sound class. Let's say your song is named mysong.mp3. Once you import it into your library, select the icon in the library, and choose linkage (right click on the icon) and then click Export for ActionScript and Export in first frame. Name it something (for this example we'll name it mysong). Click OK.

Then on your main timeline, enter the following code:

my_sound = new Sound();
my_sound.attachSound("mysong");
my_sound.onSoundComplete = function() {
// first parameter is the number of seconds the sound is offset, the second parameter is the number of loops
my_sound.start(11.95, 99);
};

When you want to start the sound the first time, add this to your frame or button code:
my_sound.start();

Study the other methods and properties of the Sound class. This gives you a lot more control of sounds than placing them on the timeline does.

Good luck,

Albee
Participant
July 19, 2006
WOW!
it's really an helpfull complete answer!!

thanks a lot Albee!
I owe you a beer