I just started to use soundmanager2, and think it's a great idea. However, I just stumbled over a problem that puzzles me: I have an audio file, from which I play sprites with the "from" and "to" arguments in play(). The user can click different buttons, and after the click I look up the relevant from and to times and pass them to SM2. Now the fragments are played, but as soon as a fragment that should be played, comes after the one previously played, it does not play. So basically, I can play fragment 10 to 1, but not 1 to 10. If I start with 5 I can play 5 again, or go down to 1, but never higher then the previous.
The problem is that the "to" argument is not updated in the failure cases. It just stays the same as specfied for the previous part. So because the duration is negative, nothing gets played. Also, the debugger shows multiple messages of the kind mySound: "to" time of xxxx reached. - one for each fragment play, where xxxx is the previous "to" argument. Happens both with Flash and HTML5 playback. (great debugging messages btw)
Edit: at the core, the problem seems to be similar to:
What a coincidence! :) In fact, when I force
_onPositionItems = ;
after the "end" method of the _applyFromTo function, the playback errors disappear. The code is actually nicely readable, even if the variables are a little odd at the beginning. Any suggestions how I could achieve that less hacky?