Sound looping problems

I got a sound to work in my actionscript for a flash movie. But when i put the loop in that frame it doesnt work, where do i want to put the onSoundComplete loop in the flash?

And I want to know if there is a way to make the onSoundComplete loop only loop 1 sound, rather then looping all the sounds in the scene.

mySound = new Sound();
mySound.loadSound("music.mp3",true);
kirupaSound.start(0, 99);
}

that shud do it whack that on like onclick or onload etc wherever u want it

thats dynamic loaded btw
-Tom

nope, that doesnt work because i want the sound to be an infinite loop. if the sound is like 2 seconds long i wanna have it looping on an infinit track, I cant figure out how to do this because if i put the onSoundComplete loop thing in the frame where i put the sound it doesnt work.

I want the sound to continue looping throught the whole movie, not just at the end frame, how do i do this for a short sound?

there is no tutorial on how to do this anywhere on kirupa, so i cant figure it out.

is there a symbol for infinit that i can put into the (0,99) thing to replace 99 with infinit?

the 99 doesnt mean it only places 99 it is infinate and loops generally sound like they are infinate anyway u shudnt be able to tell it apart

Originally posted by Troll_axethrowe
I got a sound to work in my actionscript for a flash movie. But when i put the loop in that frame it doesnt work, where do i want to put the onSoundComplete loop in the flash?

attach sound from library.

// sound object
mySound = new Sound();
// attach sound from library
mySound.attachSound("mySound");
// start sound
mySound.start();
// onSoundComplete start again
mySound.onSoundComplete = function() {
	this.start();
}

load sound dynamically. no stream.

// sound object
mySound = new Sound();
// load sound
mySound.loadSound("mySound");
// start sound onLoad
mySound.onLoad = function() {
	this.start();
}
// onSoundComplete start again
mySound.onSoundComplete = function() {
	this.start();
}

load sound dynamically. stream.

// sound object
mySound = new Sound();
// load sound
mySound.loadSound("mySound.mp3", true);
// onSoundComplete load sound again
mySound.onSoundComplete = function() {
	this.loadSound("mySound.mp3", true);
}

:wink: =)

{
Mysound = new Sound(this);
Mysound.attachSound(“coolsound”);
Mysound.start();
Mysound.onSoundComplete=function(){
this.start();
}

That is what i have in my actionscript on frame 10, it doesnt work, when it gets to frame 10 nothing starts playing. Why?

any reason for this { in the first line ? :wink:

and please use actionscript formatting tags [ as ] and [ /as ] :sleep:

oh! and another thing that usually happens… make sure you have the id name in the linkage properties of the sound :wink: =)

THANKS!!! it WAS that **** first { now she works HORRAY!!!

no problem man :wink: =)

on a side note, do u need the ;'s in the actionscript at all? because without them there is no difference i find.

in actionscript [size=1]i think javascript too[/size] you only really need them if you have more than one statement per line.

but it’s a good coding structure. :wink:

Javascript is a bit more picky with it the semi-colons than Actionscript is, and PHP is strict as the d**ickens with it. In AS you don’t need them, but its good coding practice as kax said.