"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 FriendItemComponent = (function (_super) {
    __extends(FriendItemComponent, _super);
    /**
     *
     * @param photo 头像
     * @param uname 用户名
     * @param speed 速度
     * @param timer 事件
     */
    function FriendItemComponent(photo, uname, timer) {
        var _this = _super.call(this) || this;
        _this.skinName = 'resource/skins/component/FriendItemComponent.exml';
        _this.photo = photo;
        _this.uname = uname;
        _this.timer = timer;
        _this.addEventListener(egret.Event.COMPLETE, _this.onSkinComplete, _this);
        if (_this.skin) {
            _this.onSkinComplete();
        }
        return _this;
    }
    FriendItemComponent.prototype.onSkinComplete = function () {
        this.photoImg.mask = this.photoMask;
        this.photoImg.source = this.photo;
        if (this.uname) {
            if (this.uname.length <= 7) {
                this.userNameText.text = this.uname;
            }
            else {
                this.userNameText.text = this.uname.slice(0, 6) + "...";
            }
        }
        this.removeEventListener(egret.Event.COMPLETE, this.onSkinComplete, this);
    };
    FriendItemComponent.prototype.setTime = function (timer) {
        this.timer = timer;
        this.timerText.text = this.timer;
    };
    FriendItemComponent.prototype.removeEvent = function () {
    };
    FriendItemComponent.prototype.playAct = function (start) {
        if (start === void 0) { start = 0; }
    };
    FriendItemComponent.prototype.stopAct = function () {
        // this.act.stop();
    };
    return FriendItemComponent;
}(eui.Component));
exports.FriendItemComponent = FriendItemComponent;
__reflect(FriendItemComponent.prototype, "\"c:/Users/duiba/Documents/kuwo/egret/src/components/FriendItemComponent\".FriendItemComponent");
//# sourceMappingURL=FriendItemComponent.js.map