mirror of
https://github.com/photonstorm/phaser
synced 2025-02-18 15:08:31 +00:00
Added loaded flag to prevent multiple calls to onLoad method
This commit is contained in:
parent
e1c5969bd4
commit
d743ac82c1
1 changed files with 9 additions and 0 deletions
|
@ -15,6 +15,8 @@ var HTML5AudioFile = new Class({
|
|||
{
|
||||
this.locked = locked;
|
||||
|
||||
this.loaded = false;
|
||||
|
||||
var fileConfig = {
|
||||
type: 'audio',
|
||||
extension: GetFastValue(url, 'type', ''),
|
||||
|
@ -29,6 +31,13 @@ var HTML5AudioFile = new Class({
|
|||
|
||||
onLoad: function ()
|
||||
{
|
||||
if(this.loaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.loaded = true;
|
||||
|
||||
this.loader.nextFile(this, true);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue