Phaser.Animation.FrameData = function (){ } ; Phaser.Animation.FrameData.prototype = { _frames: [] , _frameNames: [] , addFrame: function (frame){ frame.index = _AN_Read_length('length', this._frames); this._frames.push(frame); if (frame.name !== '') { this._frameNames[frame.name] = frame.index; } return frame; } , getFrame: function (index){ if (this._frames[index]) { return this._frames[index]; } return null ; } , getFrameByName: function (name){ if (this._frameNames[name] !== '') { return this._frames[this._frameNames[name]]; } return null ; } , checkFrameName: function (name){ if (this._frameNames[name] == null ) { return false ; } return true ; } , getFrameRange: function (start, end, output){ if (typeof output === "undefined") { output = [] ; } for (var i = start; i <= end; i++ ){ output.push(this._frames[i]); } return output; } , getFrameIndexes: function (output){ if (typeof output === "undefined") { output = [] ; } for (var i = 0; i < _AN_Read_length("length", this._frames); i++ ){ output.push(i); } return output; } , getFrameIndexesByName: function (input){ var output = [] ; for (var i = 0; i < _AN_Read_length("length", input); i++ ){ if (this.getFrameByName(input[i])) { output.push(this.getFrameByName(input[i]).index); } } return output; } , getAllFrames: function (){ return this._frames; } , getFrames: function (range){ var output = [] ; for (var i = 0; i < _AN_Read_length("length", range); i++ ){ output.push(this._frames[i]); } return output; } } ; Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", { get: function (){ return _AN_Read_length("length", this._frames); } , enumerable: true , configurable: true } );