What should I use to load the audio in as3 instead of load()?

Hello.

I have a setup of the 4 x 4 pads, which are essentially the buttons or video clips with 3 States to show a visual feedback (like lighting to the top of the pads when they are pressed).  I tested this configuration on an android tablet, but also a laptop touchscreen Windows 7.  Obviously, the computer laptop windows 7 is more powerful and therefore more reactive.

But not sensitive enough.

I wonder how I should approach the loading of the audio files that are short drum-kit sample sounds in mp3 format stored in a current folder next to the swf file.

Is there a better way, as a way to cache the sounds so that I don't have to reload them each time the sound event fires?

Any help on this is greatly appreciated.  (I'm just not aware of how else, right now, approaching loading sounds other than calling a new sound, each time that the button is pressed, so not really caching of sound)

You can use either:

var kickc_03:Sound = new kickc_03_mp3();  don't know whether to use Sound() or kickc_03 here...

or

var kickc_03:kickc_03_mp3 = new kickc_03_mp3();

they will both work because its subclasses kickc_03_mp3.

If I were you I would do something like:

run this time

var drumNum:int = 16;

var soundArray:Array = [null];

var C: Class;

init();

function init (): void {}

for (var i: int = 1; i<>

C = Class (getDefinitionByName (formatF (i) + "kickc_" + "_mp3");

soundArray.push (new C());

}

function formatF(n:int):String {}

s var:String=n.toString();

While (s.length<>

s = « 0 » + s ;

}

return s;

}

//////////////////////////////////////////////

now, whenever you want to generate a noise of kickc_somenum_mp3, use:

soundArray [somenum] () .play;

Tags: Adobe Animate

Similar Questions

Maybe you are looking for