Sound ID undefined in whileplaying callback?
Hi, Scott.
First, thank you for creating this great library.
I have a problem: it seems that inside a whileplaying callback function this.id is undefined.
Is this normal?
For example:
soundManager.createSound(
{
id: someId,
url: someUrl,
whileplaying: function() {soundManager._writeDebug("Sound id:" + this.id);}
}
will print "Sound Id: undefined"
Thanks in advance,
Francis
First, thank you for creating this great library.
I have a problem: it seems that inside a whileplaying callback function this.id is undefined.
Is this normal?
For example:
soundManager.createSound(
{
id: someId,
url: someUrl,
whileplaying: function() {soundManager._writeDebug("Sound id:" + this.id);}
}
will print "Sound Id: undefined"
Thanks in advance,
Francis
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.
The company marked this problem solved.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Ah yes, sorry this isn't explained better - when a sound is created, its ID is stored as "sID", as in "sound ID". This was done in part to avoid conflicts with other objects that may use "id" in the same scope (which should be rare, but I digress.)
Thus:
whileplaying: function() {
soundManager._writeDebug('Sound ID: '+this.sID);
}
The company says
this solves the problem
-
Inappropriate?Oh yes. I should have read the documentation more carefully.
Thank you very much for the answer!
Francis
I’m thankful
Loading Profile...



EMPLOYEE