I am attempting to build a file that has some draggable clips that when a hit test is positive a sound is loaded and played.
The problem is that it won't play on the first drag...it plays on second one though...this is getting really frustrating.
When I am testing...ctl+enter...I get times when it won't load...then times when it works fine. (On the same machine.) But when I open the .swf...it never works on first try...but will play on second.
What is wrong? What am I missing?
Dave
"Credit belongs to the man who is actually in the arena - T.Roosevelt
The problem is that it won't play on the first drag...it plays on second one though...this is getting really frustrating.
Code:
function whatHit(a, startPosx, startPosy){
var whatDragged = a;
if (this[whatDragged].hitTest(mcTarget)){
this[whatDragged]._x = startPosx;
this[whatDragged]._y = startPosy;
sound.loadSound ("/audio/" + whatDragged + ".mp3",false)
sound.onLoad= function(success:Boolean) {
trace (success);
if (success) {
sound.start(0,3);
}
}
}
else {
this[whatDragged]._x = startPosx;
this[whatDragged]._y = startPosy;
}
}
When I am testing...ctl+enter...I get times when it won't load...then times when it works fine. (On the same machine.) But when I open the .swf...it never works on first try...but will play on second.
What is wrong? What am I missing?
Dave
"Credit belongs to the man who is actually in the arena - T.Roosevelt