Ye, people, Dis a Great API to play with, just haff som choble!
1-I want to load an MP3
2-After Loaded I wanna play it with looping turned off (because i couldnt make it fire the SOUND_COMPLETE event if repeat: -1)
3-I want to hear when the loop ends and fire an event to trace a message (to make som more stuff later)
4-if the user has not made any choice, the loop starts again and repeat steps 2, 3, 4 until something happen
BUT I CANTGET THE SOUND TO playSound() again!!!!
so heres my code:
(dis is just som draft of what i want!)
import com.greensock.*;
import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
var piano:MP3Loader=new MP3Loader("piano_loop.mp3",{name:"piano",autoPlay:false,repeat:0});
piano.load();
// i will add som line here later, so the sound only plays when finished loading... dis is just a desktop test
piano.playSound();
//up to dis point it sounds normally
piano.addEventListener(MP3Loader.SOUND_COMPLETE,pianoCompleteHandler);
function pianoCompleteHandler(event:LoaderEvent):void
{
// YES!, the event fires as expected
// by the way the event does not fire if ----> repeat:-1
trace("piano complete loop!")
// WHY doesnt it play again?? with dis line????
piano.playSound();
}
Where am I wrong... or maybe is there som any other way of doing it?
any help is greatly appreciated
blessed!