I have built a SoundClass which handles my sound. Any time I want to call upon a sound, I call upon the class and its function. Problem is, there is like a buffering time or something. For instance, when I jump with my character, I am trying to play the jump from the SoundClass I created. It plays, but takes about 3 seconds. Btw, it does this regardless of if its in its own class, or in the same class I am calling it from. The jump.mp3 is only 4KB.
Here is how I have it set up
package {
import flash.display.Sprite;
import flash.events.*;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import flash.net.URLRequest;
public class SoundClass extends Sprite {
private var foxSoundChan:Sound;
public var jumpSound:String = "MyGame/Sounds/jump.mp3";
public var request1:URLRequest;
public function SoundClass(){
request1 = new URLRequest(jumpSound);
foxSoundChan = new Sound();
foxSoundChan.load(request1);
}
public function jumpS(){
foxSoundChan.play();
trace ("did i jump");//traces immediately
}
}
}
If I am in another class, I can call upon this by using “soundClass.jumpS();”
It plays, but takes a few seconds. I have a trace on the function jumpS() and it traces immediately.
Thank you :love: