"use strict";
var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = this && this.__extends || function __extends(t, e) { 
 function r() { 
 this.constructor = t;
}
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
r.prototype = e.prototype, t.prototype = new r();
};
Object.defineProperty(exports, "__esModule", { value: true });
var ComponentBase_1 = require("../components/ComponentBase");
var Loading = (function (_super) {
    __extends(Loading, _super);
    function Loading() {
        var _this = _super.call(this) || this;
        _this.horizontalCenter = 0;
        _this.verticalCenter = 0;
        return _this;
    }
    Object.defineProperty(Loading, "instace", {
        get: function () {
            return Loading._instance || (Loading._instance = new Loading());
        },
        enumerable: true,
        configurable: true
    });
    Loading.prototype.show = function () {
        Loading._parent.addChild(this);
        if (this.skin && !this.hasEventListener(egret.Event.ENTER_FRAME)) {
            this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
        }
        Loading._parent.visible = true;
    };
    Loading.prototype.hide = function () {
        if (Loading._parent.getChildIndex(this) == -1)
            return;
        Loading._parent.removeChild(this);
        if (this.hasEventListener(egret.Event.ENTER_FRAME)) {
            this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
        }
        if (Loading._parent.numChildren == 0) {
            Loading._parent.visible = false;
        }
    };
    Loading.init = function (parent) {
        Loading._parent = parent;
    };
    Loading.prototype.onSkinComplete = function () {
        _super.prototype.onSkinComplete.call(this);
        if (!this.hasEventListener(egret.Event.ENTER_FRAME))
            this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
    };
    Loading.prototype.onEnterFrame = function () {
        this.waitImg.rotation += 5;
    };
    Object.defineProperty(Loading.prototype, "skinKey", {
        get: function () { return 'Loading'; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Loading.prototype, "groupName", {
        get: function () { return 'loading'; },
        enumerable: true,
        configurable: true
    });
    return Loading;
}(ComponentBase_1.default));
exports.default = Loading;
__reflect(Loading.prototype, "\"c:/Users/duiba/Documents/zhonghe_answer/egret/src/loading/Loading\".Loading");
//# sourceMappingURL=Loading.js.map