I'm making an airhockey game,
I externally loaded a mp3 to play everytime the ball hit something, but the sound is only being played with a delay after the ball hit something...
What should I do?
Check out the code:
I externally loaded a mp3 to play everytime the ball hit something, but the sound is only being played with a delay after the ball hit something...
What should I do?
Check out the code:
Code:
...
contacts = sim.addContactListener();
contacts.addEventListener(QuickContacts.ADD, onAdd);
public function onAdd(evt:Event):void {
var circ:QuickObject = puck;
if (contacts.inCurrentContact(circ)) {
this.mySound.play();
}
}
...
contacts = sim.addContactListener();
contacts.addEventListener(QuickContacts.ADD, onAdd);
public function onAdd(evt:Event):void {
var circ:QuickObject = puck;
if (contacts.inCurrentContact(circ)) {
this.mySound.play();
}
}
...