Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by gxxaxx

I am getting the following error with my current game:

Error: uncaught exception: [Exception... "An attempt was made to use an object that is not, or is no longer, usable" code: "11" nsresult: "0x8053000b (NS_ERROR_DOM_INVALID_STATE_ERR)" location: "http://localhost/mrbkeys/lib/impact/sound.js Line: 188"]

Line 188 is: this.currentTrack.currentTime = 0;

I've tried trapping with tests on:

if (typeof(this.currentTrack) == 'undefined') {
return;
}
if (typeof(this.currentTrack.pause) != 'function') {
return;
}
if (typeof (this.currentTrack.currentTime) != 'number') {
return;
}

Any clue on what is causing this, or.... how to detect when the object is no longer useable?

Thanks,
Claude

1 decade ago by monkeyArms

This is quick and dirty, but I would just do:

console.log( this.currentTrack );
console.log( this.currentTrack.currentTime );

right before the line that throws the error, and see what was breaking and at what point.

1 decade ago by Arantor

What type of sound is it? How is it loaded? What browser is it?

1 decade ago by gxxaxx

Thanks for the suggestion.

The sound is a streaming music file.

Loaded with:

ig.music.add( 'media/music/bgmusic.*', name );

Browser is firefox (10.0.1)

The error is gone at the moment. It comes and goes. I'll have the error for awhile then it will go away. The game will run. But, I didn't want people with "Developer Plugin" running seeing a bunch of ugly error messages. I was hoping to catch what circumstances cause the error.

But, it has been difficult to catch. If I use the debugger, the error goes away. I think it is caused by a race condition or some other time dependent process that clears up during the time it takes me to step through the process.

The console.log is a good hint. That way I can see what is going on without stopping the game with a break point.

I'll look to see what happens when the error comes back.
Page 1 of 1
« first « previous next › last »