Sound position attribute not updating, while events not firing.
Occasionally I get this weird error where the whileplaying and whileloading events don't fire. I've also noticed that the position doesn't get updated on the songs. It's a very intermittent issue, but I've been using the defaultOptions object to create every one of the event handlers.
As far as I can tell, something must go wrong when creating the sound on the flash end and the events either just don't fire (possibly thinks it's a multishot? [which btw I have disabled]), or they don't get registered onto the sounds.
Everything else seems to work fine, like pausing and even the onload/onfinish events, so my best thought is the fake multishot option on this one.....
Fortunately it doesn't even happen very often most of the time, sometimes days will go by where I don't notice it at all even, so I wouldn't call this a priority issue, but it's certainly an interesting one.
As far as I can tell, something must go wrong when creating the sound on the flash end and the events either just don't fire (possibly thinks it's a multishot? [which btw I have disabled]), or they don't get registered onto the sounds.
Everything else seems to work fine, like pausing and even the onload/onfinish events, so my best thought is the fake multishot option on this one.....
Fortunately it doesn't even happen very often most of the time, sometimes days will go by where I don't notice it at all even, so I wouldn't call this a priority issue, but it's certainly an interesting one.
1
person has this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Odd! The MPC demo uses defaultOptions for event handlers, but the event handlers are never changed (ie., I only set defaultOptions once and use the same handlers for all sounds), and I haven't seen any event handler issues with the MPC demo.
Perhaps the state of the sound is being confused, eg. it thinks the sound is not playing when it is, or vice-versa. Flash looks to see if a sound is playing (ie., active) before calling related whileplaying() handlers and so on, so if all of those events stop being called, that is one possibility.
This is the flash 9 version, also? Might be interesting to see debug output from SM2 for the object that's been created when the bug shows up. I assume you're creating, and then trying to play a sound - so it's the first time it's been "used" and the playState is fresh, etc.
Finally (and it's unlikely), any chance there's a JS error in your event handler code for either of those methods? I'm sure that's not the case, but there's a problem with this where errors within event handlers aren't caught and reported as they normally would be by the browser (and debuggers), when the call originates from Flash - eg., for whileloading(), whileplaying() and so on.
-
Inappropriate?Yeah, I've actually stripped the code down to using console.log for debugging rather than my regular event handlers, so I doubt it's that. I would agree with you that it didn't recognize the playstate, except that I wouldn't think that the whileloading event depends on that and it's got the same issue.
It IS however possible that it's happening when the file is played more than once in a single session, as I reuse the sound objects if they need to be accessed more than once (but I unload them after each time they completely play through).
I haven't found any consistent way of watching for that error, it's actually happened on one of the first 5 sounds (none of which were the same) in one session when I was testing. As I've said, it's very intermittent.
And yes, I'm using Flash 9. The SM debug info seems to be exactly the same as it would normally be. I've also been using debugging flash in one of my environments and it doesn't seem to throw any errors either. I'm fresh out of ideas on this one which is why I'm posting, because I haven't seen anything go wrong with SM in quite a while but I can't find anything that would cause it in my own code :(
I’m unsure
-
Inappropriate?So I'd just like to present an update on this issue. I'm still not entire sure that it's fixed, but I haven't seen it happen in a while since I made a tiny change so I'm updating you now anyway.
Not sure why this would work, however I was previously using autoLoad=false and not defining the autoPlay attribute in the defaultOptions.
I have now defined autoPlay=false and it seems that the issues is gone.
The only thing I can come up with that would make any sense is that it was trying to play the sound somehow without loading it, and then the flash thought that the original instance of the sound was playing already, so when it finally loaded and played, it thought that it was a multishot sound, and so the while events would not fire.
I've looked through both my own code and the soundmanager JS and have not found anything that would in any way cause this. I don't have much experience with ActiveScripting but I checked that out and it all seemed good as well.
As I said, I have no idea why this works or would even make any difference as soundManager even defines autoPlay: false anyway.
I do still believe that it somehow ties into multishot, as every other event fires just fine and my code all uses the same events, so if it were breaking once then it would probably break every time.
Another thing I'd like to note is that if I played a sound, and it failed, then I unloaded and re-loaded then it would sometimes have fixed itself. Sometime if it were fine in the first place then it would break the second time and so on.
With any luck, it was actually a flash issue that has been resolved by an update of some sort, because I'm really running out of explanations here :D
I’m still confused, but happy anyway :)
-
Inappropriate?I think things may get a little buggy with multiShot with status and events (or at least, there's the potential) as I don't think I'm keeping track of subsequent multiShot "sound channel" objects on the Flash side aside from their onfinish() events firing.
It is a little bizarre, and kind of hard to debug and reproduce when events go missing. Thankfully, people haven't gone too crazy with trying to track the multiShot stuff etc. My recommendation generally for tracking multiple instances is just to create separate sound objects (which get their own event handlers), and then play those individually.
If Flash thinks a sound is not loading or loaded, then it may not track and fire events - but as long as values are changing (bytes, position and so on), those things should have event callbacks being made.
-
Inappropriate?See that's where it's still weird. I'm not trying to multishot anything, I mean I do play the sounds multiple times, but never at once. In fact, in the while events I have stuff in there so that if the sound playing isn't the "current" sound, then it will stop itself.
And it doesn't seem to matter whether it's the first time the sound is loaded or the 50th. It's just intermittent.
And just to note, when it happens, the values don't seem to change at all. (duration and position certainly don't update ever, didn't check on the bytes/bytestotal)
I’m goobers
-
Ah, good to know; I threw the multiShot stuff out there as a possibility, though it didn't sound like you were doing anything with it. Just another suspected vector, if you will. ;)
Loading Profile...



EMPLOYEE