Vạn Giới Chibi
Hello & Welcome to our community. Is this your first visit? Đăng Ký
Follow us on
Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube My Space Blogger
 
Kết quả 1 đến 9 của 9

Chủ đề: Vạn Giới Chibi

  1. #1
    Thành Viên Tâm Huyết nobitajx2's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    1,275
    Thanks
    670
    Thanked 361 Times in 106 Posts

    Vạn Giới Chibi

    Trên 4rum Trung Quốc và 4rum clbgamesvn cũng đã share. Mình thấy khi chat trên tất cả các kênh, đều không có hiển thị được dấu cách.
    VD: khi nhập: Vạn Giới Chibi
    Enter nó chỉ hiển thị: VạnGiớiChibi
    Link mình đã up GG: [Only registered and activated users can see links. ]
    Theo như bạn BanBanhQuay hướng dẫn
    CáI đó không phải lỗi mà do filter.Game vốn dĩ không sản xuất cho VN,nó dành cho CN,nên nó không có khái niệm được dấu cách,sửa nó thì tìm đoạn filter rồi bỏ nó đi là được.
    Nhưng do mình không chuyên, nên mò mẫm cũng hơn 1 tuần chưa ra nên mạo muội lên đây lập topic hỏi. Mong được chỉ dẫn và xin trả phí.
    Code trong modul/Chat/ChatPanel
    package game.client.module.chat
    {
    import flash.display.DisplayObject;
    import flash.events.FocusEvent;
    import flash.events.KeyboardEvent;
    import flash.events.MouseEvent;
    import flash.text.TextFieldType;
    import flash.utils.clearTimeout;
    import flash.utils.getTimer;
    import flash.utils.setTimeout;
    import game.client.GameWorld;
    import game.client.Global;
    import game.client.data.BagData;
    import game.client.data.TeamData;
    import game.client.data.VipData;
    import game.client.module.ComponentUtils;
    import game.client.module.Panel;
    import game.client.module.bag.BagDefine;
    import game.client.module.broadcast.CenterBroadcastCenter ;
    import game.client.module.broadcast.CenterBroadcastDown;
    import game.client.module.broadcast.CenterBroadcastUp;
    import game.client.module.broadcast.SystemTip;
    import game.client.module.broadcast.WordTip;
    import game.client.module.common.Face;
    import game.client.module.common.FaceCreator;
    import game.client.module.common.IHasInput;
    import game.client.module.common.RichText;
    import game.client.module.common.TextList;
    import game.client.module.gm.GMPanel;
    import game.client.module.grid.Equip;
    import game.client.module.grid.Gem;
    import game.client.module.grid.Item;
    import game.client.module.pet.PetInfo;
    import game.client.module.shop.ShopConstant;
    import game.client.module.systemsetting.SystemSettingPane l;
    import game.client.module.tip.ShowTip;
    import game.client.module.tip.Tip;
    import game.client.net.Message;
    import game.client.ui.CButton;
    import game.client.ui.CComboBox;
    import game.client.ui.CComboBoxListItem;
    import game.component.Bitmap;
    import game.component.Button;
    import game.component.ComboBox;
    import game.component.ComboBoxListItem;
    import game.component.Container;
    import game.component.GroupRadioButton;
    import game.component.RadioButton;
    import game.component.Scroll;
    import game.component.Text;
    import game.core.gameUnit.magic.Effect;
    import game.core.manager.MapManager;
    import game.core.manager.UIManager;
    import game.core.utils.ChatFilter;
    import game.core.utils.StringFilter;
    import game.core.utils.Utils;

    public class ChatPanel extends Panel implements IHasInput
    {

    private static var ins:ChatPanel;

    private static const TAG_MAP_STRING:String = "%map";

    private static const HISTORY_NUM_MAX:int = 10;

    private static var _pageSpeaker:RadioButton;

    private static var _gmButton:Button;

    private static var _lockButton:RadioButton;

    private static var _faceButton:Button;

    private static var _enterButton:Button;

    private static var speakerBG:Bitmap;

    private static var _msgArray:Array = [];

    private static const ERROR:Array = ["","","Ngươi không có Bang","Ngươi không có Ðội","","Ngươi không có Loa"];

    private static var lastSendTime:uint;

    private static const KEY_UP:int = 38;

    private static const KEY_DOWN:int = 40;

    private static var currentHistoryIndex:int;


    public var isInit:Boolean;

    private var _input:Text;

    private var _type:int;

    private var _channelComboBox:ComboBox;

    private var normalContainer:Container;

    private var normalMsgScroll:Scroll;

    private var longContainer:Container;

    private var longMsgScroll:Scroll;

    private var smallContainer:Container;

    private var smallMsgScroll:Scroll;

    private var _itemArray:Array;

    private var _itemArrayPos:int = 0;

    private var normalTextList:TextList;

    private var longTextList:TextList;

    private var smallTextList:TextList;

    private var historyInputList:Array;

    private var richText:RichText;

    private var kuozhan:Button;

    private var shen:Button;

    private var suo:Button;

    public var btnList:Array;

    private var tabs:GroupRadioButton;

    private var sizeOffsets:Array;

    private var sizeStates:Array;

    private var sizeIndex:int = -1;

    private var effect:Effect;

    private var clearTimeIndex:uint;

    public function ChatPanel()
    {
    this._type = ChatConstant.CHAT_TYPE_WORLD;
    this._itemArray = [];
    this.normalTextList = new TextList();
    this.longTextList = new TextList();
    this.smallTextList = new TextList();
    this.historyInputList = [];
    this.richText = new RichText();
    this.btnList = [];
    this.sizeOffsets = [-50,-200,-50,45];
    this.sizeStates = [2,3,2,1];
    width = 265;
    height = 226;
    super();
    this.init();
    }

    public static function get instance() : ChatPanel
    {
    if(!ins)
    {
    ins = new ChatPanel();
    }
    return ins;
    }

    override public function init() : void
    {
    var i:int = 0;
    var comboBoxListItem:ComboBoxListItem = null;
    var bitmap4:Bitmap = null;
    canEsc = false;
    this.smallContainer = ComponentUtils.CreateContainer2(this,this,"smallCo ntainer",264,65,1,95);
    ComponentUtils.CreateBg1(this.smallContainer,this, "liaotiandikuang",264,85,1,0,[5,5,5,5],"liaotiandikuang");
    this.normalContainer = ComponentUtils.CreateContainer2(this,this,"normalC ontainer",264,179,1,0);
    ComponentUtils.CreateBg1(this.normalContainer,this ,"liaotiandikuang",264,179,1,0,[5,5,5,5],"liaotiandikuang");
    this.longContainer = ComponentUtils.CreateContainer2(this,this,"longCon tainer",264,330,1,-150);
    ComponentUtils.CreateBg1(this.longContainer,this," liaotiandikuang",264,330,1,0,[5,5,5,5],"liaotiandikuang");
    ComponentUtils.CreateBg1(this,this,"liaotiandiban" ,265,48,0,178,[5,5,5,5],"liaotiandiban");
    ComponentUtils.CreateBg1(this,this,"liaotianshuruk uang",212,38,50,183,[5,5,5,5],"liaotianshurukuang");
    this._input = new Text();
    this._input.x = 54;
    this._input.y = 184;
    this._input.type = TextFieldType.INPUT;
    this._input.text = "Nhập nội dung Chat";
    this._input.width = 185;
    this._input.height = 36;
    this._input.mouseEnabled = true;
    this._input.selectable = true;
    this._input.wordWrap = true;
    this._input.addEventListener(FocusEvent.FOCUS_IN,t his.onInputFocusIn);
    this._input.addEventListener(KeyboardEvent.KEY_UP, this.onKey);
    addChild(this._input);
    _lockButton = ComponentUtils.CreateRadio(this,this,["liaotiankuang_77xxxx","liaotiankuang_77xxss","lia otiankuang_77xxss","liaotiankuang_77xxxx"],[5,5,5,5],"lock","",0,0,22,22,25,201);
    _lockButton.addEventListener(MouseEvent.CLICK,this .onLock);
    _lockButton.select = false;
    _lockButton.addEventListener(MouseEvent.ROLL_OVER, this.onLockTip);
    _lockButton.addEventListener(MouseEvent.ROLL_OUT,t his.onLockTip);
    speakerBG = ComponentUtils.CreateBitmap1(this,this,"speakerBG" ,"speakerBG",264,46,2,-50);
    this.removeChild(speakerBG);
    this.richText.leading = 2;
    this.richText.y = 9;
    this.richText.x = 0;
    this.richText.width = 264;
    this.tabs = new GroupRadioButton();
    this.tabs.x = 0;
    this.tabs.y = 158;
    addChild(this.tabs);
    this._channelComboBox = new CComboBox("pingdaoyuanze",this,46,20);
    this._channelComboBox.x = 2;
    this._channelComboBox.y = 181;
    this._channelComboBox.mouseEnabled = true;
    for(i = 0; i < ChatConstant.CHANNEL.length; i++)
    {
    comboBoxListItem = new CComboBoxListItem(this);
    comboBoxListItem.text = ChatConstant.CHANNEL[i];
    comboBoxListItem.value = i;
    this._channelComboBox.addItem(comboBoxListItem);
    _msgArray[i] = [];
    this.writeMsg(i,"<font color=\'#ffffff\'> Chào mừng đến<b>《Tam Giới Chibi》</b>\nNgăn game xấu Từ chối game lậu Chú ý tự bảo vệ, đề phòng lừa gạt Chống nghiện game Sắp xếp thời gian chơi game hợp lý!</font>");
    }
    for(i = 0; i < ChatConstant.CHANNEL.length; i++)
    {
    if(i == 5)
    {
    _pageSpeaker = ComponentUtils.CreateRadio3(this.tabs,this,i + "","",23,22,0,0,16777215,12,1);
    bitmap4 = ComponentUtils.CreateBitmap1(_pageSpeaker,this,"li aotianxiaolbtubiao","bitmap4",11,10,6,6);
    _pageSpeaker.x = 5 * 39;
    _pageSpeaker.addEventListener(MouseEvent.CLICK,thi s.onChatTypeChange);
    _pageSpeaker.addEventListener(MouseEvent.ROLL_OVER ,this.onSpeakerRollOver);
    _pageSpeaker.addEventListener(MouseEvent.ROLL_OUT, Tip.hide);
    }
    else
    {
    this.btnList[i] = ComponentUtils.CreateRadio3(this.tabs,this,i + "",ChatConstant.CHANNEL[i],41,22,0,0,16777215,12,1);
    this.btnList[i].name = i;
    this.btnList[i].x = i * 39;
    this.btnList[i].addEventListener(MouseEvent.CLICK,this.onChatType Change);
    }
    }
    this.btnList[0].dispatchEvent(Global.clickEvent);
    this.btnList[0].select = true;
    this.type = ChatConstant.CHAT_TYPE_WORLD;
    Tip.bind("Ấn để đổi kênh chat",this._channelComboBox);
    addChild(this._channelComboBox);
    _faceButton = ComponentUtils.CreateImgButton(this,this,["liaotiankuang_8","liaotiankuang_8","liaotiankuang _8"],"_faceButton","",14,15,242,185);
    Tip.bind("Chọn cảm xúc",_faceButton);
    _faceButton.addEventListener(MouseEvent.CLICK,this .onFace);
    _faceButton.addEventListener(MouseEvent.MOUSE_DOWN ,function(e:MouseEvent):void
    {
    e.stopPropagation();
    });
    _enterButton = ComponentUtils.CreateImgButton(this,this,["liaotiankuang_9","liaotiankuang_9","liaotiankuang _9"],"_enterButton","",20,20,239,200);
    _enterButton.addEventListener(MouseEvent.CLICK,thi s.onSend);
    this.kuozhan = ComponentUtils.CreateImgButton(this,this,["chatPanel_shensuo","chatPanel_shensuo","chatPanel _shensuo"],"_enterButton","",22,22,242,158);
    this.kuozhan.addEventListener(MouseEvent.CLICK,thi s.onExt);
    Tip.bind("Ấn mở rộng hoặc thu nhỏ khung chat",this.kuozhan);
    var zuobiao:Button = ComponentUtils.CreateImgButton(this,this,["XY","XY","XY"],"zuobiao","",22,22,219,158);
    Tip.bind("Gửi vị trí hiện tại vào chat",zuobiao);
    zuobiao.addEventListener(MouseEvent.CLICK,this.sen dCoord);
    this.smallTextList.x = 15;
    this.smallTextList.y = 97;
    this.smallTextList.textWidth = 247;
    this.smallContainer.addChild(this.smallTextList);
    this.normalTextList.x = 15;
    this.normalTextList.y = 2;
    this.normalTextList.textWidth = 247;
    this.normalContainer.addChild(this.normalTextList) ;
    this.longTextList.x = 17;
    this.longTextList.y = -147;
    this.longTextList.textWidth = 247;
    this.longContainer.addChild(this.longTextList);
    this.smallMsgScroll = ComponentUtils.CreateScroll(this.smallContainer,th is,"smallMsgScroll",14,61,2,1);
    this.normalMsgScroll = ComponentUtils.CreateScroll(this.normalContainer,t his,"normalMsgScroll",14,156,2,1);
    this.longMsgScroll = ComponentUtils.CreateScroll(this.longContainer,thi s,"longMsgScroll",14,306,2,1);
    this.onExt(null);
    addEventListener(MouseEvent.CLICK,this.onGo);
    this.visible = true;
    UIManager.registerPanel(this);
    this.suo = ComponentUtils.CreateCButton(this,this,"shen","",2 2,22,CButton.TYPE_NOMAL_1,2,201);
    var bitmap3:Bitmap = ComponentUtils.CreateBitmap1(this.suo,this,"zuojia ntou","bitmap",7,11,6,6);
    this.suo.addEventListener(MouseEvent.CLICK,this.on Hide);
    Tip.bind("Ấn để ẩn khung chat",this.suo);
    var btnX:int = 0;
    var btnY:int = Global.stage.stageHeight - 25;
    this.shen = ComponentUtils.CreateCButton(parent,this,"shen","" ,22,22,CButton.TYPE_NOMAL_1,btnX,btnY);
    var bitmap2:Bitmap = ComponentUtils.CreateBitmap1(this.shen,this,"youji antou","bitmap2",7,11,6,6);
    this.shen.visible = false;
    this.shen.addEventListener(MouseEvent.CLICK,this.o nShow);
    Tip.bind("Ấn để mở khung chat",this.shen);
    }

    public function resetOpenChatBtnIndex() : void
    {
    UIManager.instance.addChild(this.shen);
    }

    private function onHide(e:MouseEvent) : void
    {
    this.visible = false;
    this.shen.visible = true;
    this.suo.visible = false;
    }

    private function onShow(e:MouseEvent) : void
    {
    this.visible = true;
    this.shen.visible = false;
    this.suo.visible = true;
    }

    private function onExt(e:MouseEvent = null) : void
    {
    this.sizeIndex++;
    if(this.sizeIndex < 0 || this.sizeIndex >= this.sizeStates.length)
    {
    this.sizeIndex = 0;
    }
    speakerBG.y = this.richText.y = this.sizeOffsets[this.sizeIndex];
    if(this.effect)
    {
    this.effect.x = speakerBG.x + speakerBG.width / 2 - 6;
    this.effect.y = speakerBG.y + speakerBG.height / 2 + 6;
    }
    this.longContainer.visible = false;
    this.normalContainer.visible = false;
    this.smallContainer.visible = false;
    switch(this.sizeStates[this.sizeIndex])
    {
    case 1:
    this.smallMsgScroll.auto = !_lockButton.select;
    this.smallMsgScroll.type = Scroll.TYPE_PIXEL;
    this.smallMsgScroll.target = this.smallTextList;
    this.smallContainer.visible = true;
    this.smallTextList.dispatchEvent(Global.changeEven t);
    break;
    case 2:
    this.normalMsgScroll.auto = !_lockButton.select;
    this.normalMsgScroll.type = Scroll.TYPE_PIXEL;
    this.normalMsgScroll.target = this.normalTextList;
    this.normalContainer.visible = true;
    this.normalTextList.dispatchEvent(Global.changeEve nt);
    break;
    case 3:
    this.longMsgScroll.auto = !_lockButton.select;
    this.longMsgScroll.type = Scroll.TYPE_PIXEL;
    this.longMsgScroll.target = this.longTextList;
    this.longContainer.visible = true;
    this.longTextList.dispatchEvent(Global.changeEvent );
    }
    }

    private function onGo(e:MouseEvent) : void
    {
    if(e.target == this._input || e.target is Button || !ChatConstant.canGo)
    {
    return;
    }
    GameWorld(root).mouseDown(e);
    }

    private function writeSystemMsg(str:String) : void
    {
    for(var i:int = 0; i < ChatConstant.CHANNEL.length; i++)
    {
    this.writeMsg(i,"<font color=\'#ff0000\'>" + str + "</font>");
    }
    }

    private function onLockTip(e:MouseEvent) : void
    {
    e.target.userData = Boolean(e.target.select)?"Mở khóa chat":"Khóa chat";
    if(e.type == MouseEvent.ROLL_OUT)
    {
    Tip.hide();
    }
    else
    {
    Tip.show(e);
    }
    }

    private function onChatTypeChange(e:MouseEvent) : void
    {
    var selectNum:int = int(e.target.name);
    switch(selectNum)
    {
    case 0:
    this.type = ChatConstant.CHAT_TYPE_WORLD;
    break;
    case 1:
    this.type = ChatConstant.CHAT_TYPE_CAMP;
    break;
    case 2:
    this.type = ChatConstant.CHAT_TYPE_GUILD;
    break;
    case 3:
    this.type = ChatConstant.CHAT_TYPE_TEAM;
    break;
    case 4:
    this.type = ChatConstant.CHAT_TYPE_NEAR;
    break;
    case 5:
    this.type = ChatConstant.CHAT_TYPE_SPEAKER;
    }
    this._input.maxChars = this.type == ChatConstant.CHAT_TYPE_SPEAKER?int(29):int(50);
    this.smallTextList.data = _msgArray[this.type];
    this.normalTextList.data = _msgArray[this.type];
    this.longTextList.data = _msgArray[this.type];
    }

    private function onInputFocusIn(e:FocusEvent) : void
    {
    if(this._input.text == "Nhập nội dung Chat" || this._input.text == "Kênh Loa cần tiêu hao 1 Loa.")
    {
    this._input.text = "";
    }
    this._input.htmlText = Utils.font("","#FFFFFF");
    }

    private function onLock(e:MouseEvent) : void
    {
    if(this.normalMsgScroll)
    {
    this.normalMsgScroll.auto = !this.normalMsgScroll.auto;
    }
    if(this.longMsgScroll)
    {
    this.longMsgScroll.auto = !this.longMsgScroll.auto;
    }
    this.onLockTip(e);
    }

    private function onFace(e:MouseEvent) : void
    {
    Face.rootPanel = this;
    var face:Face = FaceCreator.createFace(this,e.currentTarget as DisplayObject) as Face;
    if(contains(face))
    {
    removeChild(face);
    }
    else
    {
    addChild(face);
    }
    }

    private function onSend(e:MouseEvent) : void
    {
    this.doSend();
    }

    private function onRoll(e:MouseEvent) : void
    {
    if(e.type == MouseEvent.ROLL_OVER)
    {
    Tip.show(e);
    }
    else
    {
    Tip.hide(e);
    }
    }

    private function onGM(e:MouseEvent) : void
    {
    GMPanel.instance.visible = !GMPanel.instance.visible;
    }

    public function sendCoord(e:MouseEvent = null) : void
    {
    this.doSend(TAG_MAP_STRING + "," + MapManager.mapInfo.id + "," + Global.hero.x + "," + Global.hero.y);
    }

    public function doSend(msg:String = "") : void
    {
    var error:String = null;
    var nFreeCount:int = 0;
    var index:int = 0;
    var type:int = int(this._channelComboBox.selectedItem.value);
    var sendmsg:String = msg == ""?this._input.text:msg;
    var mapRegex:RegExp = /^%map\,[0-9]+\,[0-9]+\,[0-9]+[\s\S]{0,}$/g;
    if(msg == "" && mapRegex.test(this._input.text))
    {
    sendmsg = this._input.text.replace(/^%map/g,"");
    }
    Global.stage.focus = this._input;
    if(sendmsg == "" || sendmsg == "Nhập nội dung Chat")
    {
    return;
    }
    if(this._type == ChatConstant.CHAT_TYPE_SPEAKER && sendmsg == "Kênh Loa cần tiêu hao 1 Loa.")
    {
    return;
    }
    if(getTimer() - lastSendTime < ChatConstant.TIME_SEND[type])
    {
    if(this._input.text.length > TAG_MAP_STRING.length && this._input.text.substr(0,TAG_MAP_STRING.length) == TAG_MAP_STRING)
    {
    this._input.text = "";
    }
    this.writeMsg(type,Utils.font("Bạn chat quá nhanh, " + int((ChatConstant.TIME_SEND[type] - (getTimer() - lastSendTime)) / 1000 + 1) + " giây sau thử lại.","#ffff00"));
    return;
    }
    switch(type)
    {
    case ChatConstant.CHAT_TYPE_GUILD:
    if(!Global.hero.guildName)
    {
    error = ERROR[type];
    }
    break;
    case ChatConstant.CHAT_TYPE_TEAM:
    if(!TeamData.hasTeam())
    {
    error = ERROR[type];
    }
    break;
    case ChatConstant.CHAT_TYPE_SPEAKER:
    if(VipData.vipLv > 0)
    {
    nFreeCount = VipData.vipFreeSpeakerTotal[VipData.vipLv] - VipData.usedFreeSpeaker;
    if(nFreeCount > 0)
    {
    break;
    }
    }
    if(!BagData.getCount(BagDefine.SPEAKER))
    {
    ShopConstant.quickBuy("Loa",BagDefine.SPEAKER);
    return;
    }
    break;
    }
    if(!error)
    {
    sendmsg = StringFilter.replace(sendmsg);
    if(ChatFilter.isNeedToFilter(sendmsg))
    {
    this.GC_CHAT(type,Global.hero.name,Global.hero.id, Global.hero.guildId,Global.hero.sex,Global.hero.vi pType,Global.hero.vipLv,0,0,sendmsg,Global.hero.ca mp);
    }
    else
    {
    Message.CG_CHAT(type,Utils.filterHtml(sendmsg));
    }
    lastSendTime = getTimer();
    }
    else
    {
    this.writeMsg(type,Utils.font(error,"#ff0000"));
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont(error,"#ff0000"));
    }
    var isMapPos:Boolean = mapRegex.test(sendmsg);
    if(!isMapPos)
    {
    index = this.historyInputList.indexOf(this._input.text);
    if(index != -1)
    {
    this.historyInputList.splice(index,1);
    }
    this.historyInputList.push(this._input.text);
    if(this.historyInputList.length > HISTORY_NUM_MAX)
    {
    this.historyInputList.shift();
    }
    currentHistoryIndex = this.historyInputList.length;
    }
    this._input.text = "";
    this._input.htmlText = Utils.font("","#FFFFFF");
    this._input.color = 16777215;
    }

    public function writeMsg(type:int, msg:String) : void
    {
    _msgArray[type].push(msg);
    if(_msgArray[type].length > this.normalTextList.TEXT_NUM_MAX)
    {
    _msgArray[type].shift();
    }
    if(this._type == type)
    {
    this.smallTextList.data = _msgArray[type];
    this.normalTextList.data = _msgArray[type];
    this.longTextList.data = _msgArray[type];
    }
    }

    public function GC_CHAT(msgType:int, rolename:String, objId:int, guildId:int, sex:int, vipType:int, vipLv:int, guide:int, no1:int, msg:String, camp:int) : void
    {
    var msgStr:String = null;
    var content:String = null;
    var position:Array = null;
    var mapId:int = 0;
    var x:int = 0;
    var y:int = 0;
    if(!SystemSettingPanel.canShowChatMsg(this.type))
    {
    return;
    }
    if(objId == -1)
    {
    this.writeMsg(msgType,msg);
    return;
    }
    var titles:String = "";
    if(guide == 1)
    {
    titles = titles + Utils.font("★Tân Thủ Chỉ Ðạo Viên★","#ffc800");
    }
    if(no1 == 1)
    {
    titles = titles + Utils.font("★Phong Thiên Chiến Thần★","#ffc800");
    }
    if(vipLv != 0)
    {
    titles = titles + Utils.font("[VIP" + vipLv + "]",Global.VIP_COLOR[vipType]);
    }
    var strSex:String = Boolean(ChatConstant.SEX[sex])?Utils.font(ChatConstant.SEX[sex][0],ChatConstant.SEX[sex][1]):"";
    var server:String = rolename.split("]")[0] + "]";
    var name:String = rolename.split("]")[1];
    if(name == null)
    {
    return;
    }
    var ma:RegExp = /%map\,[0-9]+\,[0-9]+\,[0-9]+/g;
    var matchArr:Array = msg.match(ma);
    if(matchArr != null && matchArr.length > 0)
    {
    msgStr = matchArr[0];
    if(msg.length > TAG_MAP_STRING.length && msgStr.substr(0,TAG_MAP_STRING.length) == TAG_MAP_STRING)
    {
    position = msg.split(",");
    mapId = position[1];
    x = position[2];
    y = position[3];
    msg = ChatConstant.getLink("[" + MapManager.getMapName(mapId) + "] x:" + x + " y:" + y + "",ChatConstant.COLOR_XY,true,ChatConstant.TYPE_ON _XY,mapId,x,y);
    }
    }
    var colorString:String = ChatConstant.COLOR_NAME;
    if(name.substr(0,2) == "GM")
    {
    colorString = ChatConstant.COLOR_NAME_GM;
    }
    if(msgType == ChatConstant.CHAT_TYPE_WORLD || ChatConstant.CHAT_TYPE_SPEAKER)
    {
    content = this.getChannel(msgType) + titles + strSex + Utils.font("[" + Global.CAMP_NAMES[camp] + "]",Global.CAMP_NAME_COLORS[camp]) + Utils.font(server,colorString) + ChatConstant.getLink(name,colorString,true,ChatCon stant.TYPE_ACTION_ON_NAME_MENU,objId,guildId,rolen ame) + Utils.font(":","#FFFFFF") + (this.type == ChatConstant.CHAT_TYPE_SPEAKER?Utils.font(msg,Chat Constant.COLOR[ChatConstant.CHAT_TYPE_SPEAKER]):msg);
    }
    else
    {
    content = this.getChannel(msgType) + titles + strSex + Utils.font(server,colorString) + ChatConstant.getLink(name,colorString,false,ChatCo nstant.TYPE_ACTION_ON_NAME_MENU,objId,guildId,role name) + Utils.font(":","#FFFFFF") + (this.type == ChatConstant.CHAT_TYPE_SPEAKER?Utils.font(msg,Chat Constant.COLOR[ChatConstant.CHAT_TYPE_SPEAKER]):msg);
    }
    this.writeMsg(msgType,content);
    if(ChatConstant.CHAT_TYPE_WORLD != msgType)
    {
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,content );
    }
    if(msgType == ChatConstant.CHAT_TYPE_SPEAKER)
    {
    this.showSpeaker(content);
    }
    if(msgType == ChatConstant.CHAT_TYPE_GUILD)
    {
    dispatch("guild_chat");
    }
    if(msgType == ChatConstant.CHAT_TYPE_NEAR && Global.hero.id == objId)
    {
    Global.hero.say(msg);
    }
    }

    public function getChannel(type:int) : String
    {
    var channel:String = null;
    var color:String = null;
    color = ChatConstant.COLOR[type];
    channel = Utils.font("【" + ChatConstant.FONT[type] + "】",color);
    return channel;
    }

    private function showSpeaker(msg:String) : void
    {
    if(this.effect)
    {
    if(this.effect && this.effect.parent)
    {
    this.effect.parent.removeChild(this.effect);
    this.effect = null;
    }
    }
    this.richText.htmlText = msg;
    this.richText.y = this.sizeOffsets[this.sizeIndex];
    clearTimeout(this.clearTimeIndex);
    this.effect = Effect.getEffect();
    this.effect.init(2011,true,1000);
    this.effect.x = speakerBG.x + speakerBG.width / 2 - 6;
    this.effect.y = speakerBG.y + speakerBG.height / 2 + 6;
    addChild(this.effect);
    addChild(speakerBG);
    addChild(this.richText);
    this.clearTimeIndex = setTimeout(this.hideSpeaker,20 * 1000);
    }

    private function hideSpeaker() : void
    {
    removeChild(speakerBG);
    removeChild(this.richText);
    if(this.effect)
    {
    if(this.effect && this.effect.parent)
    {
    this.effect.parent.removeChild(this.effect);
    }
    if(this.effect)
    {
    this.effect.dispose();
    this.effect = null;
    }
    }
    }

    public function GC_ITEM_SHOW(msgType:int, rolename:String, objId:int, sex:int, guildId:int, vipLv:int, vipType:int, camp:int, title:int, no1:int, type:int, msg:String, itemData:Array, equipData:Array, gemData:Array, petData:Array) : void
    {
    if(_msgArray[msgType].length > 50)
    {
    _msgArray[msgType].shift();
    }
    var titles:String = "";
    if(no1 == 1)
    {
    titles = titles + Utils.font("★Phong Thiên Chiến Thần★","#ffc800");
    }
    if(vipType != 0)
    {
    titles = titles + Utils.font("[VIP" + vipLv + "]",Global.VIP_COLOR[vipType]);
    }
    var strSex:String = Boolean(ChatConstant.SEX[sex])?Utils.font(ChatConstant.SEX[sex][0],ChatConstant.SEX[sex][1]):"";
    var server:String = rolename.split("]")[0] + "]";
    var name:String = rolename.split("]")[1];
    var content:String = this.getChannel(msgType) + titles + strSex + Utils.font("[" + Global.CAMP_NAMES[camp] + "]",Global.CAMP_NAME_COLORS[camp]) + Utils.font(server,ChatConstant.COLOR_NAME) + (rolename == Global.hero.name?Utils.font(name,ChatConstant.COLO R_NAME):ChatConstant.getLink(name,ChatConstant.COL OR_NAME,false,ChatConstant.TYPE_ACTION_ON_NAME_MEN U,objId,guildId,rolename)) + ":";
    if(type == Item.ITEM)
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,itemData[0]);
    }
    else if(type == Item.EQUIP)
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,equipDat a[0]);
    }
    else if(type == Item.GEM)
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,gemData[0]);
    }
    else
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,petData[0]);
    }
    this.writeMsg(msgType,content);
    if(ChatConstant.CHAT_TYPE_WORLD != msgType)
    {
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,content );
    }
    }

    public function CG_ITEM_SHOW(channel:int, type:int, index:int, petIndex:int) : void
    {
    if(getTimer() - lastSendTime < ChatConstant.TIME_SEND[channel])
    {
    this.writeMsg(channel,Utils.font("Bạn chat quá nhanh, " + int((ChatConstant.TIME_SEND[channel] - (getTimer() - lastSendTime)) / 1000 + 1) + " giây sau thử lại.","#ffff00"));
    return;
    }
    Message.CG_ITEM_SHOW(channel,type,index,petIndex);
    lastSendTime = getTimer();
    }

    public function CG_TEAM_COPY_SCENE_INVITE_BROADCAST(mapID:int, tips:String) : void
    {
    if(getTimer() - lastSendTime < ChatConstant.TIME_SEND[ChatConstant.CHAT_TYPE_WORLD])
    {
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("Bạn chat quá nhanh, " + int((ChatConstant.TIME_SEND[ChatConstant.CHAT_TYPE_WORLD] - (getTimer() - lastSendTime)) / 1000 + 1) + " giây sau thử lại.","#ffff00"));
    return;
    }
    Message.CG_CHAT(ChatConstant.CHAT_TYPE_WORLD,tips + "Họp thành đội chiêu mộ <font color=\'#0ff00\'><a href=\'event:7 " + Global.hero.name + "\'> <u>Tham gia</u></a></font>");
    lastSendTime = getTimer();
    }

    private function GetItemShowMsg(type:int, rolename:String, sex:int, msg:String, data:Array) : String
    {
    var str:String = null;
    var item:Item = null;
    var equip:Equip = null;
    var quality:String = null;
    var gem:Gem = null;
    var petetInfo = null;
    if(this._itemArray[this._itemArrayPos])
    {
    this._itemArray[this._itemArrayPos].dispose();
    }
    if(type == Item.ITEM)
    {
    item = Item.getInstance() as Item;
    item.init(data);
    this._itemArray[this._itemArrayPos] = item;
    str = ChatConstant.getLink("【" + msg + "】x" + item.count,Global.colorRgb[item.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    else if(type == Item.EQUIP)
    {
    equip = Equip.getInstance() as Equip;
    equip.init(data);
    quality = !!equip.IsFashionHorseWing()?"":Global.qualityDesc[equip.quality];
    this._itemArray[this._itemArrayPos] = equip;
    str = ChatConstant.getLink("【" + quality + msg + "】",Global.colorRgb[equip.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    else if(type == Item.GEM)
    {
    gem = Gem.getInstance() as Gem;
    gem.init(data);
    this._itemArray[this._itemArrayPos] = gem;
    str = ChatConstant.getLink("【" + msg + "】x" + gem.count,Global.colorRgb[gem.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    else
    {
    pet = PetInfo.getInstance() as PetInfo;
    pet.init(data);
    this._itemArray[this._itemArrayPos] = pet;
    str = ChatConstant.getLink(msg,Global.colorRgb[pet.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    this._itemArrayPos = ++this._itemArrayPos % 50;
    return str;
    }

    public function onShowItem(index:int, rolename:String, sex:int) : void
    {
    ShowTip.show(this._itemArray[index],rolename,sex,this);
    }

    private function onKey(e:KeyboardEvent) : void
    {
    if(e.keyCode != KEY_UP && e.keyCode != KEY_DOWN || !this.historyInputList.length)
    {
    return;
    }
    switch(e.keyCode)
    {
    case KEY_UP:
    currentHistoryIndex--;
    if(currentHistoryIndex < 0)
    {
    currentHistoryIndex = 0;
    }
    break;
    case KEY_DOWN:
    currentHistoryIndex++;
    if(currentHistoryIndex > this.historyInputList.length - 1)
    {
    currentHistoryIndex = this.historyInputList.length - 1;
    }
    }
    this._input.text = this.historyInputList[currentHistoryIndex];
    this._input.setSelection(this._input.text.length,t his._input.text.length);
    }

    public function set type(value:int) : void
    {
    this._type = value;
    this._channelComboBox.select = value;
    if(value == ChatConstant.CHAT_TYPE_SPEAKER)
    {
    this._input.htmlText = Utils.font("Kênh Loa cần tiêu hao 1 Loa.","#FFFFFF");
    }
    else if(this._input.text == "Kênh Loa cần tiêu hao 1 Loa.")
    {
    this._input.text = "";
    }
    }

    public function get type() : int
    {
    return this._type;
    }

    private function onSpeakerRollOver(e:MouseEvent) : void
    {
    var nFreeCount:int = 0;
    if(VipData.vipLv > 0)
    {
    nFreeCount = VipData.vipFreeSpeakerTotal[VipData.vipLv] - VipData.usedFreeSpeaker;
    if(nFreeCount > 0)
    {
    e.currentTarget.userData = "Loa có thể cho tất cả người chơi nghe được tin tức của ngươi\nMỗi lần phát loa cần tiêu hao một cái Loa, Loa nhưng ở thương thành mua\nVIP hiện tại [" + VipData.vipLv + "],\nNgày có thể dùng " + nFreeCount + " lần miễn phí phát loa";
    }
    else
    {
    e.currentTarget.userData = "Loa có thể cho tất cả người chơi nghe được tin tức của ngươi\nMỗi lần phát loa cần tiêu hao một cái Loa, Loa nhưng ở thương thành mua\nVIP hiện tại [" + VipData.vipLv + "],\nSố lần sử dụng miễn phí loa trong ngày đã hết";
    }
    }
    else
    {
    e.currentTarget.userData = "Loa có thể cho tất cả người chơi nghe được tin tức của ngươi\nMỗi lần phát loa cần tiêu hao một cái Loa, Loa nhưng ở thương thành mua\nTrở thành VIP mỗi ngày hưởng miễn phí nhiều lần loa phát thanh đặc quyền";
    }
    Tip.show(e);
    }

    public function GC_BROADCAST(pos:int, msg:String) : void
    {
    switch(pos)
    {
    case 1:
    CenterBroadcastUp.addMsg(msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + Utils.font(msg,"#fff000"));
    break;
    case 2:
    CenterBroadcastCenter.addMsg(msg);
    break;
    case 3:
    CenterBroadcastDown.addMsg(msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    break;
    case 4:
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    break;
    case 5:
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_TEAM,Utils.fo nt("【HT】","#ff0000") + msg);
    break;
    case 6:
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_GUILD,Utils.f ont("【HT】","#ff0000") + msg);
    break;
    case 7:
    this.writeMsg(ChatConstant.CHAT_TYPE_SPEAKER,Utils .font("【HT】","#ff0000") + msg);
    this.showSpeaker(Utils.font("【Loa】",Global.col orRgb[Global.COLOR_GOLD]) + msg);
    break;
    case 8:
    CenterBroadcastUp.addMsg(msg);
    break;
    case 9:
    CenterBroadcastCenter.addMsg(msg);
    break;
    case 10:
    SystemTip.addMsg(msg);
    break;
    case 11:
    WordTip.show(msg);
    break;
    case 12:
    CenterBroadcastDown.addMsg(msg);
    }
    }

    public function getMsgArray(type:int) : Array
    {
    var arr:Array = [];
    for(var i:int = 1; i < _msgArray[type].length; i++)
    {
    arr.push(_msgArray[type][i]);
    }
    return arr;
    }

    public function get input() : Text
    {
    return this._input;
    }

    public function set input(value:Text) : void
    {
    this._input = value;
    }

    override public function set visible(value:Boolean) : void
    {
    super.visible = value;
    }

    override public function onResize() : void
    {
    if(Global.stage.stageWidth - 1345 < 0)
    {
    x = 0;
    y = Global.stage.stageHeight - height - 90;
    }
    else
    {
    x = 0;
    y = Global.stage.stageHeight - height;
    }
    if(this.shen)
    {
    this.shen.y = int(Global.stage.stageHeight - 25);
    }
    }
    }
    }
    Code trong modul/Chat/ChatConstant
    package game.client.module.chat
    {
    import flash.display.DisplayObject;
    import flash.events.FocusEvent;
    import flash.events.KeyboardEvent;
    import flash.events.MouseEvent;
    import flash.text.TextFieldType;
    import flash.utils.clearTimeout;
    import flash.utils.getTimer;
    import flash.utils.setTimeout;
    import game.client.GameWorld;
    import game.client.Global;
    import game.client.data.BagData;
    import game.client.data.TeamData;
    import game.client.data.VipData;
    import game.client.module.ComponentUtils;
    import game.client.module.Panel;
    import game.client.module.bag.BagDefine;
    import game.client.module.broadcast.CenterBroadcastCenter ;
    import game.client.module.broadcast.CenterBroadcastDown;
    import game.client.module.broadcast.CenterBroadcastUp;
    import game.client.module.broadcast.SystemTip;
    import game.client.module.broadcast.WordTip;
    import game.client.module.common.Face;
    import game.client.module.common.FaceCreator;
    import game.client.module.common.IHasInput;
    import game.client.module.common.RichText;
    import game.client.module.common.TextList;
    import game.client.module.gm.GMPanel;
    import game.client.module.grid.Equip;
    import game.client.module.grid.Gem;
    import game.client.module.grid.Item;
    import game.client.module.pet.PetInfo;
    import game.client.module.shop.ShopConstant;
    import game.client.module.systemsetting.SystemSettingPane l;
    import game.client.module.tip.ShowTip;
    import game.client.module.tip.Tip;
    import game.client.net.Message;
    import game.client.ui.CButton;
    import game.client.ui.CComboBox;
    import game.client.ui.CComboBoxListItem;
    import game.component.Bitmap;
    import game.component.Button;
    import game.component.ComboBox;
    import game.component.ComboBoxListItem;
    import game.component.Container;
    import game.component.GroupRadioButton;
    import game.component.RadioButton;
    import game.component.Scroll;
    import game.component.Text;
    import game.core.gameUnit.magic.Effect;
    import game.core.manager.MapManager;
    import game.core.manager.UIManager;
    import game.core.utils.ChatFilter;
    import game.core.utils.StringFilter;
    import game.core.utils.Utils;

    public class ChatPanel extends Panel implements IHasInput
    {

    private static var ins:ChatPanel;

    private static const TAG_MAP_STRING:String = "%map";

    private static const HISTORY_NUM_MAX:int = 10;

    private static var _pageSpeaker:RadioButton;

    private static var _gmButton:Button;

    private static var _lockButton:RadioButton;

    private static var _faceButton:Button;

    private static var _enterButton:Button;

    private static var speakerBG:Bitmap;

    private static var _msgArray:Array = [];

    private static const ERROR:Array = ["","","Ngươi không có Bang","Ngươi không có Ðội","","Ngươi không có Loa"];

    private static var lastSendTime:uint;

    private static const KEY_UP:int = 38;

    private static const KEY_DOWN:int = 40;

    private static var currentHistoryIndex:int;


    public var isInit:Boolean;

    private var _input:Text;

    private var _type:int;

    private var _channelComboBox:ComboBox;

    private var normalContainer:Container;

    private var normalMsgScroll:Scroll;

    private var longContainer:Container;

    private var longMsgScroll:Scroll;

    private var smallContainer:Container;

    private var smallMsgScroll:Scroll;

    private var _itemArray:Array;

    private var _itemArrayPos:int = 0;

    private var normalTextList:TextList;

    private var longTextList:TextList;

    private var smallTextList:TextList;

    private var historyInputList:Array;

    private var richText:RichText;

    private var kuozhan:Button;

    private var shen:Button;

    private var suo:Button;

    public var btnList:Array;

    private var tabs:GroupRadioButton;

    private var sizeOffsets:Array;

    private var sizeStates:Array;

    private var sizeIndex:int = -1;

    private var effect:Effect;

    private var clearTimeIndex:uint;

    public function ChatPanel()
    {
    this._type = ChatConstant.CHAT_TYPE_WORLD;
    this._itemArray = [];
    this.normalTextList = new TextList();
    this.longTextList = new TextList();
    this.smallTextList = new TextList();
    this.historyInputList = [];
    this.richText = new RichText();
    this.btnList = [];
    this.sizeOffsets = [-50,-200,-50,45];
    this.sizeStates = [2,3,2,1];
    width = 265;
    height = 226;
    super();
    this.init();
    }

    public static function get instance() : ChatPanel
    {
    if(!ins)
    {
    ins = new ChatPanel();
    }
    return ins;
    }

    override public function init() : void
    {
    var i:int = 0;
    var comboBoxListItem:ComboBoxListItem = null;
    var bitmap4:Bitmap = null;
    canEsc = false;
    this.smallContainer = ComponentUtils.CreateContainer2(this,this,"smallCo ntainer",264,65,1,95);
    ComponentUtils.CreateBg1(this.smallContainer,this, "liaotiandikuang",264,85,1,0,[5,5,5,5],"liaotiandikuang");
    this.normalContainer = ComponentUtils.CreateContainer2(this,this,"normalC ontainer",264,179,1,0);
    ComponentUtils.CreateBg1(this.normalContainer,this ,"liaotiandikuang",264,179,1,0,[5,5,5,5],"liaotiandikuang");
    this.longContainer = ComponentUtils.CreateContainer2(this,this,"longCon tainer",264,330,1,-150);
    ComponentUtils.CreateBg1(this.longContainer,this," liaotiandikuang",264,330,1,0,[5,5,5,5],"liaotiandikuang");
    ComponentUtils.CreateBg1(this,this,"liaotiandiban" ,265,48,0,178,[5,5,5,5],"liaotiandiban");
    ComponentUtils.CreateBg1(this,this,"liaotianshuruk uang",212,38,50,183,[5,5,5,5],"liaotianshurukuang");
    this._input = new Text();
    this._input.x = 54;
    this._input.y = 184;
    this._input.type = TextFieldType.INPUT;
    this._input.text = "Nhập nội dung Chat";
    this._input.width = 185;
    this._input.height = 36;
    this._input.mouseEnabled = true;
    this._input.selectable = true;
    this._input.wordWrap = true;
    this._input.addEventListener(FocusEvent.FOCUS_IN,t his.onInputFocusIn);
    this._input.addEventListener(KeyboardEvent.KEY_UP, this.onKey);
    addChild(this._input);
    _lockButton = ComponentUtils.CreateRadio(this,this,["liaotiankuang_77xxxx","liaotiankuang_77xxss","lia otiankuang_77xxss","liaotiankuang_77xxxx"],[5,5,5,5],"lock","",0,0,22,22,25,201);
    _lockButton.addEventListener(MouseEvent.CLICK,this .onLock);
    _lockButton.select = false;
    _lockButton.addEventListener(MouseEvent.ROLL_OVER, this.onLockTip);
    _lockButton.addEventListener(MouseEvent.ROLL_OUT,t his.onLockTip);
    speakerBG = ComponentUtils.CreateBitmap1(this,this,"speakerBG" ,"speakerBG",264,46,2,-50);
    this.removeChild(speakerBG);
    this.richText.leading = 2;
    this.richText.y = 9;
    this.richText.x = 0;
    this.richText.width = 264;
    this.tabs = new GroupRadioButton();
    this.tabs.x = 0;
    this.tabs.y = 158;
    addChild(this.tabs);
    this._channelComboBox = new CComboBox("pingdaoyuanze",this,46,20);
    this._channelComboBox.x = 2;
    this._channelComboBox.y = 181;
    this._channelComboBox.mouseEnabled = true;
    for(i = 0; i < ChatConstant.CHANNEL.length; i++)
    {
    comboBoxListItem = new CComboBoxListItem(this);
    comboBoxListItem.text = ChatConstant.CHANNEL[i];
    comboBoxListItem.value = i;
    this._channelComboBox.addItem(comboBoxListItem);
    _msgArray[i] = [];
    this.writeMsg(i,"<font color=\'#ffffff\'> Chào mừng đến<b>《Tam Giới Chibi》</b>\nNgăn game xấu Từ chối game lậu Chú ý tự bảo vệ, đề phòng lừa gạt Chống nghiện game Sắp xếp thời gian chơi game hợp lý!</font>");
    }
    for(i = 0; i < ChatConstant.CHANNEL.length; i++)
    {
    if(i == 5)
    {
    _pageSpeaker = ComponentUtils.CreateRadio3(this.tabs,this,i + "","",23,22,0,0,16777215,12,1);
    bitmap4 = ComponentUtils.CreateBitmap1(_pageSpeaker,this,"li aotianxiaolbtubiao","bitmap4",11,10,6,6);
    _pageSpeaker.x = 5 * 39;
    _pageSpeaker.addEventListener(MouseEvent.CLICK,thi s.onChatTypeChange);
    _pageSpeaker.addEventListener(MouseEvent.ROLL_OVER ,this.onSpeakerRollOver);
    _pageSpeaker.addEventListener(MouseEvent.ROLL_OUT, Tip.hide);
    }
    else
    {
    this.btnList[i] = ComponentUtils.CreateRadio3(this.tabs,this,i + "",ChatConstant.CHANNEL[i],41,22,0,0,16777215,12,1);
    this.btnList[i].name = i;
    this.btnList[i].x = i * 39;
    this.btnList[i].addEventListener(MouseEvent.CLICK,this.onChatType Change);
    }
    }
    this.btnList[0].dispatchEvent(Global.clickEvent);
    this.btnList[0].select = true;
    this.type = ChatConstant.CHAT_TYPE_WORLD;
    Tip.bind("Ấn để đổi kênh chat",this._channelComboBox);
    addChild(this._channelComboBox);
    _faceButton = ComponentUtils.CreateImgButton(this,this,["liaotiankuang_8","liaotiankuang_8","liaotiankuang _8"],"_faceButton","",14,15,242,185);
    Tip.bind("Chọn cảm xúc",_faceButton);
    _faceButton.addEventListener(MouseEvent.CLICK,this .onFace);
    _faceButton.addEventListener(MouseEvent.MOUSE_DOWN ,function(e:MouseEvent):void
    {
    e.stopPropagation();
    });
    _enterButton = ComponentUtils.CreateImgButton(this,this,["liaotiankuang_9","liaotiankuang_9","liaotiankuang _9"],"_enterButton","",20,20,239,200);
    _enterButton.addEventListener(MouseEvent.CLICK,thi s.onSend);
    this.kuozhan = ComponentUtils.CreateImgButton(this,this,["chatPanel_shensuo","chatPanel_shensuo","chatPanel _shensuo"],"_enterButton","",22,22,242,158);
    this.kuozhan.addEventListener(MouseEvent.CLICK,thi s.onExt);
    Tip.bind("Ấn mở rộng hoặc thu nhỏ khung chat",this.kuozhan);
    var zuobiao:Button = ComponentUtils.CreateImgButton(this,this,["XY","XY","XY"],"zuobiao","",22,22,219,158);
    Tip.bind("Gửi vị trí hiện tại vào chat",zuobiao);
    zuobiao.addEventListener(MouseEvent.CLICK,this.sen dCoord);
    this.smallTextList.x = 15;
    this.smallTextList.y = 97;
    this.smallTextList.textWidth = 247;
    this.smallContainer.addChild(this.smallTextList);
    this.normalTextList.x = 15;
    this.normalTextList.y = 2;
    this.normalTextList.textWidth = 247;
    this.normalContainer.addChild(this.normalTextList) ;
    this.longTextList.x = 17;
    this.longTextList.y = -147;
    this.longTextList.textWidth = 247;
    this.longContainer.addChild(this.longTextList);
    this.smallMsgScroll = ComponentUtils.CreateScroll(this.smallContainer,th is,"smallMsgScroll",14,61,2,1);
    this.normalMsgScroll = ComponentUtils.CreateScroll(this.normalContainer,t his,"normalMsgScroll",14,156,2,1);
    this.longMsgScroll = ComponentUtils.CreateScroll(this.longContainer,thi s,"longMsgScroll",14,306,2,1);
    this.onExt(null);
    addEventListener(MouseEvent.CLICK,this.onGo);
    this.visible = true;
    UIManager.registerPanel(this);
    this.suo = ComponentUtils.CreateCButton(this,this,"shen","",2 2,22,CButton.TYPE_NOMAL_1,2,201);
    var bitmap3:Bitmap = ComponentUtils.CreateBitmap1(this.suo,this,"zuojia ntou","bitmap",7,11,6,6);
    this.suo.addEventListener(MouseEvent.CLICK,this.on Hide);
    Tip.bind("Ấn để ẩn khung chat",this.suo);
    var btnX:int = 0;
    var btnY:int = Global.stage.stageHeight - 25;
    this.shen = ComponentUtils.CreateCButton(parent,this,"shen","" ,22,22,CButton.TYPE_NOMAL_1,btnX,btnY);
    var bitmap2:Bitmap = ComponentUtils.CreateBitmap1(this.shen,this,"youji antou","bitmap2",7,11,6,6);
    this.shen.visible = false;
    this.shen.addEventListener(MouseEvent.CLICK,this.o nShow);
    Tip.bind("Ấn để mở khung chat",this.shen);
    }

    public function resetOpenChatBtnIndex() : void
    {
    UIManager.instance.addChild(this.shen);
    }

    private function onHide(e:MouseEvent) : void
    {
    this.visible = false;
    this.shen.visible = true;
    this.suo.visible = false;
    }

    private function onShow(e:MouseEvent) : void
    {
    this.visible = true;
    this.shen.visible = false;
    this.suo.visible = true;
    }

    private function onExt(e:MouseEvent = null) : void
    {
    this.sizeIndex++;
    if(this.sizeIndex < 0 || this.sizeIndex >= this.sizeStates.length)
    {
    this.sizeIndex = 0;
    }
    speakerBG.y = this.richText.y = this.sizeOffsets[this.sizeIndex];
    if(this.effect)
    {
    this.effect.x = speakerBG.x + speakerBG.width / 2 - 6;
    this.effect.y = speakerBG.y + speakerBG.height / 2 + 6;
    }
    this.longContainer.visible = false;
    this.normalContainer.visible = false;
    this.smallContainer.visible = false;
    switch(this.sizeStates[this.sizeIndex])
    {
    case 1:
    this.smallMsgScroll.auto = !_lockButton.select;
    this.smallMsgScroll.type = Scroll.TYPE_PIXEL;
    this.smallMsgScroll.target = this.smallTextList;
    this.smallContainer.visible = true;
    this.smallTextList.dispatchEvent(Global.changeEven t);
    break;
    case 2:
    this.normalMsgScroll.auto = !_lockButton.select;
    this.normalMsgScroll.type = Scroll.TYPE_PIXEL;
    this.normalMsgScroll.target = this.normalTextList;
    this.normalContainer.visible = true;
    this.normalTextList.dispatchEvent(Global.changeEve nt);
    break;
    case 3:
    this.longMsgScroll.auto = !_lockButton.select;
    this.longMsgScroll.type = Scroll.TYPE_PIXEL;
    this.longMsgScroll.target = this.longTextList;
    this.longContainer.visible = true;
    this.longTextList.dispatchEvent(Global.changeEvent );
    }
    }

    private function onGo(e:MouseEvent) : void
    {
    if(e.target == this._input || e.target is Button || !ChatConstant.canGo)
    {
    return;
    }
    GameWorld(root).mouseDown(e);
    }

    private function writeSystemMsg(str:String) : void
    {
    for(var i:int = 0; i < ChatConstant.CHANNEL.length; i++)
    {
    this.writeMsg(i,"<font color=\'#ff0000\'>" + str + "</font>");
    }
    }

    private function onLockTip(e:MouseEvent) : void
    {
    e.target.userData = Boolean(e.target.select)?"Mở khóa chat":"Khóa chat";
    if(e.type == MouseEvent.ROLL_OUT)
    {
    Tip.hide();
    }
    else
    {
    Tip.show(e);
    }
    }

    private function onChatTypeChange(e:MouseEvent) : void
    {
    var selectNum:int = int(e.target.name);
    switch(selectNum)
    {
    case 0:
    this.type = ChatConstant.CHAT_TYPE_WORLD;
    break;
    case 1:
    this.type = ChatConstant.CHAT_TYPE_CAMP;
    break;
    case 2:
    this.type = ChatConstant.CHAT_TYPE_GUILD;
    break;
    case 3:
    this.type = ChatConstant.CHAT_TYPE_TEAM;
    break;
    case 4:
    this.type = ChatConstant.CHAT_TYPE_NEAR;
    break;
    case 5:
    this.type = ChatConstant.CHAT_TYPE_SPEAKER;
    }
    this._input.maxChars = this.type == ChatConstant.CHAT_TYPE_SPEAKER?int(29):int(50);
    this.smallTextList.data = _msgArray[this.type];
    this.normalTextList.data = _msgArray[this.type];
    this.longTextList.data = _msgArray[this.type];
    }

    private function onInputFocusIn(e:FocusEvent) : void
    {
    if(this._input.text == "Nhập nội dung Chat" || this._input.text == "Kênh Loa cần tiêu hao 1 Loa.")
    {
    this._input.text = "";
    }
    this._input.htmlText = Utils.font("","#FFFFFF");
    }

    private function onLock(e:MouseEvent) : void
    {
    if(this.normalMsgScroll)
    {
    this.normalMsgScroll.auto = !this.normalMsgScroll.auto;
    }
    if(this.longMsgScroll)
    {
    this.longMsgScroll.auto = !this.longMsgScroll.auto;
    }
    this.onLockTip(e);
    }

    private function onFace(e:MouseEvent) : void
    {
    Face.rootPanel = this;
    var face:Face = FaceCreator.createFace(this,e.currentTarget as DisplayObject) as Face;
    if(contains(face))
    {
    removeChild(face);
    }
    else
    {
    addChild(face);
    }
    }

    private function onSend(e:MouseEvent) : void
    {
    this.doSend();
    }

    private function onRoll(e:MouseEvent) : void
    {
    if(e.type == MouseEvent.ROLL_OVER)
    {
    Tip.show(e);
    }
    else
    {
    Tip.hide(e);
    }
    }

    private function onGM(e:MouseEvent) : void
    {
    GMPanel.instance.visible = !GMPanel.instance.visible;
    }

    public function sendCoord(e:MouseEvent = null) : void
    {
    this.doSend(TAG_MAP_STRING + "," + MapManager.mapInfo.id + "," + Global.hero.x + "," + Global.hero.y);
    }

    public function doSend(msg:String = "") : void
    {
    var error:String = null;
    var nFreeCount:int = 0;
    var index:int = 0;
    var type:int = int(this._channelComboBox.selectedItem.value);
    var sendmsg:String = msg == ""?this._input.text:msg;
    var mapRegex:RegExp = /^%map\,[0-9]+\,[0-9]+\,[0-9]+[\s\S]{0,}$/g;
    if(msg == "" && mapRegex.test(this._input.text))
    {
    sendmsg = this._input.text.replace(/^%map/g,"");
    }
    Global.stage.focus = this._input;
    if(sendmsg == "" || sendmsg == "Nhập nội dung Chat")
    {
    return;
    }
    if(this._type == ChatConstant.CHAT_TYPE_SPEAKER && sendmsg == "Kênh Loa cần tiêu hao 1 Loa.")
    {
    return;
    }
    if(getTimer() - lastSendTime < ChatConstant.TIME_SEND[type])
    {
    if(this._input.text.length > TAG_MAP_STRING.length && this._input.text.substr(0,TAG_MAP_STRING.length) == TAG_MAP_STRING)
    {
    this._input.text = "";
    }
    this.writeMsg(type,Utils.font("Bạn chat quá nhanh, " + int((ChatConstant.TIME_SEND[type] - (getTimer() - lastSendTime)) / 1000 + 1) + " giây sau thử lại.","#ffff00"));
    return;
    }
    switch(type)
    {
    case ChatConstant.CHAT_TYPE_GUILD:
    if(!Global.hero.guildName)
    {
    error = ERROR[type];
    }
    break;
    case ChatConstant.CHAT_TYPE_TEAM:
    if(!TeamData.hasTeam())
    {
    error = ERROR[type];
    }
    break;
    case ChatConstant.CHAT_TYPE_SPEAKER:
    if(VipData.vipLv > 0)
    {
    nFreeCount = VipData.vipFreeSpeakerTotal[VipData.vipLv] - VipData.usedFreeSpeaker;
    if(nFreeCount > 0)
    {
    break;
    }
    }
    if(!BagData.getCount(BagDefine.SPEAKER))
    {
    ShopConstant.quickBuy("Loa",BagDefine.SPEAKER);
    return;
    }
    break;
    }
    if(!error)
    {
    sendmsg = StringFilter.replace(sendmsg);
    if(ChatFilter.isNeedToFilter(sendmsg))
    {
    this.GC_CHAT(type,Global.hero.name,Global.hero.id, Global.hero.guildId,Global.hero.sex,Global.hero.vi pType,Global.hero.vipLv,0,0,sendmsg,Global.hero.ca mp);
    }
    else
    {
    Message.CG_CHAT(type,Utils.filterHtml(sendmsg));
    }
    lastSendTime = getTimer();
    }
    else
    {
    this.writeMsg(type,Utils.font(error,"#ff0000"));
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont(error,"#ff0000"));
    }
    var isMapPos:Boolean = mapRegex.test(sendmsg);
    if(!isMapPos)
    {
    index = this.historyInputList.indexOf(this._input.text);
    if(index != -1)
    {
    this.historyInputList.splice(index,1);
    }
    this.historyInputList.push(this._input.text);
    if(this.historyInputList.length > HISTORY_NUM_MAX)
    {
    this.historyInputList.shift();
    }
    currentHistoryIndex = this.historyInputList.length;
    }
    this._input.text = "";
    this._input.htmlText = Utils.font("","#FFFFFF");
    this._input.color = 16777215;
    }

    public function writeMsg(type:int, msg:String) : void
    {
    _msgArray[type].push(msg);
    if(_msgArray[type].length > this.normalTextList.TEXT_NUM_MAX)
    {
    _msgArray[type].shift();
    }
    if(this._type == type)
    {
    this.smallTextList.data = _msgArray[type];
    this.normalTextList.data = _msgArray[type];
    this.longTextList.data = _msgArray[type];
    }
    }

    public function GC_CHAT(msgType:int, rolename:String, objId:int, guildId:int, sex:int, vipType:int, vipLv:int, guide:int, no1:int, msg:String, camp:int) : void
    {
    var msgStr:String = null;
    var content:String = null;
    var position:Array = null;
    var mapId:int = 0;
    var x:int = 0;
    var y:int = 0;
    if(!SystemSettingPanel.canShowChatMsg(this.type))
    {
    return;
    }
    if(objId == -1)
    {
    this.writeMsg(msgType,msg);
    return;
    }
    var titles:String = "";
    if(guide == 1)
    {
    titles = titles + Utils.font("★Tân Thủ Chỉ Ðạo Viên★","#ffc800");
    }
    if(no1 == 1)
    {
    titles = titles + Utils.font("★Phong Thiên Chiến Thần★","#ffc800");
    }
    if(vipLv != 0)
    {
    titles = titles + Utils.font("[VIP" + vipLv + "]",Global.VIP_COLOR[vipType]);
    }
    var strSex:String = Boolean(ChatConstant.SEX[sex])?Utils.font(ChatConstant.SEX[sex][0],ChatConstant.SEX[sex][1]):"";
    var server:String = rolename.split("]")[0] + "]";
    var name:String = rolename.split("]")[1];
    if(name == null)
    {
    return;
    }
    var ma:RegExp = /%map\,[0-9]+\,[0-9]+\,[0-9]+/g;
    var matchArr:Array = msg.match(ma);
    if(matchArr != null && matchArr.length > 0)
    {
    msgStr = matchArr[0];
    if(msg.length > TAG_MAP_STRING.length && msgStr.substr(0,TAG_MAP_STRING.length) == TAG_MAP_STRING)
    {
    position = msg.split(",");
    mapId = position[1];
    x = position[2];
    y = position[3];
    msg = ChatConstant.getLink("[" + MapManager.getMapName(mapId) + "] x:" + x + " y:" + y + "",ChatConstant.COLOR_XY,true,ChatConstant.TYPE_ON _XY,mapId,x,y);
    }
    }
    var colorString:String = ChatConstant.COLOR_NAME;
    if(name.substr(0,2) == "GM")
    {
    colorString = ChatConstant.COLOR_NAME_GM;
    }
    if(msgType == ChatConstant.CHAT_TYPE_WORLD || ChatConstant.CHAT_TYPE_SPEAKER)
    {
    content = this.getChannel(msgType) + titles + strSex + Utils.font("[" + Global.CAMP_NAMES[camp] + "]",Global.CAMP_NAME_COLORS[camp]) + Utils.font(server,colorString) + ChatConstant.getLink(name,colorString,true,ChatCon stant.TYPE_ACTION_ON_NAME_MENU,objId,guildId,rolen ame) + Utils.font(":","#FFFFFF") + (this.type == ChatConstant.CHAT_TYPE_SPEAKER?Utils.font(msg,Chat Constant.COLOR[ChatConstant.CHAT_TYPE_SPEAKER]):msg);
    }
    else
    {
    content = this.getChannel(msgType) + titles + strSex + Utils.font(server,colorString) + ChatConstant.getLink(name,colorString,false,ChatCo nstant.TYPE_ACTION_ON_NAME_MENU,objId,guildId,role name) + Utils.font(":","#FFFFFF") + (this.type == ChatConstant.CHAT_TYPE_SPEAKER?Utils.font(msg,Chat Constant.COLOR[ChatConstant.CHAT_TYPE_SPEAKER]):msg);
    }
    this.writeMsg(msgType,content);
    if(ChatConstant.CHAT_TYPE_WORLD != msgType)
    {
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,content );
    }
    if(msgType == ChatConstant.CHAT_TYPE_SPEAKER)
    {
    this.showSpeaker(content);
    }
    if(msgType == ChatConstant.CHAT_TYPE_GUILD)
    {
    dispatch("guild_chat");
    }
    if(msgType == ChatConstant.CHAT_TYPE_NEAR && Global.hero.id == objId)
    {
    Global.hero.say(msg);
    }
    }

    public function getChannel(type:int) : String
    {
    var channel:String = null;
    var color:String = null;
    color = ChatConstant.COLOR[type];
    channel = Utils.font("【" + ChatConstant.FONT[type] + "】",color);
    return channel;
    }

    private function showSpeaker(msg:String) : void
    {
    if(this.effect)
    {
    if(this.effect && this.effect.parent)
    {
    this.effect.parent.removeChild(this.effect);
    this.effect = null;
    }
    }
    this.richText.htmlText = msg;
    this.richText.y = this.sizeOffsets[this.sizeIndex];
    clearTimeout(this.clearTimeIndex);
    this.effect = Effect.getEffect();
    this.effect.init(2011,true,1000);
    this.effect.x = speakerBG.x + speakerBG.width / 2 - 6;
    this.effect.y = speakerBG.y + speakerBG.height / 2 + 6;
    addChild(this.effect);
    addChild(speakerBG);
    addChild(this.richText);
    this.clearTimeIndex = setTimeout(this.hideSpeaker,20 * 1000);
    }

    private function hideSpeaker() : void
    {
    removeChild(speakerBG);
    removeChild(this.richText);
    if(this.effect)
    {
    if(this.effect && this.effect.parent)
    {
    this.effect.parent.removeChild(this.effect);
    }
    if(this.effect)
    {
    this.effect.dispose();
    this.effect = null;
    }
    }
    }

    public function GC_ITEM_SHOW(msgType:int, rolename:String, objId:int, sex:int, guildId:int, vipLv:int, vipType:int, camp:int, title:int, no1:int, type:int, msg:String, itemData:Array, equipData:Array, gemData:Array, petData:Array) : void
    {
    if(_msgArray[msgType].length > 50)
    {
    _msgArray[msgType].shift();
    }
    var titles:String = "";
    if(no1 == 1)
    {
    titles = titles + Utils.font("★Phong Thiên Chiến Thần★","#ffc800");
    }
    if(vipType != 0)
    {
    titles = titles + Utils.font("[VIP" + vipLv + "]",Global.VIP_COLOR[vipType]);
    }
    var strSex:String = Boolean(ChatConstant.SEX[sex])?Utils.font(ChatConstant.SEX[sex][0],ChatConstant.SEX[sex][1]):"";
    var server:String = rolename.split("]")[0] + "]";
    var name:String = rolename.split("]")[1];
    var content:String = this.getChannel(msgType) + titles + strSex + Utils.font("[" + Global.CAMP_NAMES[camp] + "]",Global.CAMP_NAME_COLORS[camp]) + Utils.font(server,ChatConstant.COLOR_NAME) + (rolename == Global.hero.name?Utils.font(name,ChatConstant.COLO R_NAME):ChatConstant.getLink(name,ChatConstant.COL OR_NAME,false,ChatConstant.TYPE_ACTION_ON_NAME_MEN U,objId,guildId,rolename)) + ":";
    if(type == Item.ITEM)
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,itemData[0]);
    }
    else if(type == Item.EQUIP)
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,equipDat a[0]);
    }
    else if(type == Item.GEM)
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,gemData[0]);
    }
    else
    {
    content = content + this.GetItemShowMsg(type,rolename,sex,msg,petData[0]);
    }
    this.writeMsg(msgType,content);
    if(ChatConstant.CHAT_TYPE_WORLD != msgType)
    {
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,content );
    }
    }

    public function CG_ITEM_SHOW(channel:int, type:int, index:int, petIndex:int) : void
    {
    if(getTimer() - lastSendTime < ChatConstant.TIME_SEND[channel])
    {
    this.writeMsg(channel,Utils.font("Bạn chat quá nhanh, " + int((ChatConstant.TIME_SEND[channel] - (getTimer() - lastSendTime)) / 1000 + 1) + " giây sau thử lại.","#ffff00"));
    return;
    }
    Message.CG_ITEM_SHOW(channel,type,index,petIndex);
    lastSendTime = getTimer();
    }

    public function CG_TEAM_COPY_SCENE_INVITE_BROADCAST(mapID:int, tips:String) : void
    {
    if(getTimer() - lastSendTime < ChatConstant.TIME_SEND[ChatConstant.CHAT_TYPE_WORLD])
    {
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("Bạn chat quá nhanh, " + int((ChatConstant.TIME_SEND[ChatConstant.CHAT_TYPE_WORLD] - (getTimer() - lastSendTime)) / 1000 + 1) + " giây sau thử lại.","#ffff00"));
    return;
    }
    Message.CG_CHAT(ChatConstant.CHAT_TYPE_WORLD,tips + "Họp thành đội chiêu mộ <font color=\'#0ff00\'><a href=\'event:7 " + Global.hero.name + "\'> <u>Tham gia</u></a></font>");
    lastSendTime = getTimer();
    }

    private function GetItemShowMsg(type:int, rolename:String, sex:int, msg:String, data:Array) : String
    {
    var str:String = null;
    var item:Item = null;
    var equip:Equip = null;
    var quality:String = null;
    var gem:Gem = null;
    var petetInfo = null;
    if(this._itemArray[this._itemArrayPos])
    {
    this._itemArray[this._itemArrayPos].dispose();
    }
    if(type == Item.ITEM)
    {
    item = Item.getInstance() as Item;
    item.init(data);
    this._itemArray[this._itemArrayPos] = item;
    str = ChatConstant.getLink("【" + msg + "】x" + item.count,Global.colorRgb[item.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    else if(type == Item.EQUIP)
    {
    equip = Equip.getInstance() as Equip;
    equip.init(data);
    quality = !!equip.IsFashionHorseWing()?"":Global.qualityDesc[equip.quality];
    this._itemArray[this._itemArrayPos] = equip;
    str = ChatConstant.getLink("【" + quality + msg + "】",Global.colorRgb[equip.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    else if(type == Item.GEM)
    {
    gem = Gem.getInstance() as Gem;
    gem.init(data);
    this._itemArray[this._itemArrayPos] = gem;
    str = ChatConstant.getLink("【" + msg + "】x" + gem.count,Global.colorRgb[gem.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    else
    {
    pet = PetInfo.getInstance() as PetInfo;
    pet.init(data);
    this._itemArray[this._itemArrayPos] = pet;
    str = ChatConstant.getLink(msg,Global.colorRgb[pet.color],true,ChatConstant.TYPE_ACTION_ON_SHOW_ITEM,this._ itemArrayPos,rolename,sex);
    }
    this._itemArrayPos = ++this._itemArrayPos % 50;
    return str;
    }

    public function onShowItem(index:int, rolename:String, sex:int) : void
    {
    ShowTip.show(this._itemArray[index],rolename,sex,this);
    }

    private function onKey(e:KeyboardEvent) : void
    {
    if(e.keyCode != KEY_UP && e.keyCode != KEY_DOWN || !this.historyInputList.length)
    {
    return;
    }
    switch(e.keyCode)
    {
    case KEY_UP:
    currentHistoryIndex--;
    if(currentHistoryIndex < 0)
    {
    currentHistoryIndex = 0;
    }
    break;
    case KEY_DOWN:
    currentHistoryIndex++;
    if(currentHistoryIndex > this.historyInputList.length - 1)
    {
    currentHistoryIndex = this.historyInputList.length - 1;
    }
    }
    this._input.text = this.historyInputList[currentHistoryIndex];
    this._input.setSelection(this._input.text.length,t his._input.text.length);
    }

    public function set type(value:int) : void
    {
    this._type = value;
    this._channelComboBox.select = value;
    if(value == ChatConstant.CHAT_TYPE_SPEAKER)
    {
    this._input.htmlText = Utils.font("Kênh Loa cần tiêu hao 1 Loa.","#FFFFFF");
    }
    else if(this._input.text == "Kênh Loa cần tiêu hao 1 Loa.")
    {
    this._input.text = "";
    }
    }

    public function get type() : int
    {
    return this._type;
    }

    private function onSpeakerRollOver(e:MouseEvent) : void
    {
    var nFreeCount:int = 0;
    if(VipData.vipLv > 0)
    {
    nFreeCount = VipData.vipFreeSpeakerTotal[VipData.vipLv] - VipData.usedFreeSpeaker;
    if(nFreeCount > 0)
    {
    e.currentTarget.userData = "Loa có thể cho tất cả người chơi nghe được tin tức của ngươi\nMỗi lần phát loa cần tiêu hao một cái Loa, Loa nhưng ở thương thành mua\nVIP hiện tại [" + VipData.vipLv + "],\nNgày có thể dùng " + nFreeCount + " lần miễn phí phát loa";
    }
    else
    {
    e.currentTarget.userData = "Loa có thể cho tất cả người chơi nghe được tin tức của ngươi\nMỗi lần phát loa cần tiêu hao một cái Loa, Loa nhưng ở thương thành mua\nVIP hiện tại [" + VipData.vipLv + "],\nSố lần sử dụng miễn phí loa trong ngày đã hết";
    }
    }
    else
    {
    e.currentTarget.userData = "Loa có thể cho tất cả người chơi nghe được tin tức của ngươi\nMỗi lần phát loa cần tiêu hao một cái Loa, Loa nhưng ở thương thành mua\nTrở thành VIP mỗi ngày hưởng miễn phí nhiều lần loa phát thanh đặc quyền";
    }
    Tip.show(e);
    }

    public function GC_BROADCAST(pos:int, msg:String) : void
    {
    switch(pos)
    {
    case 1:
    CenterBroadcastUp.addMsg(msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + Utils.font(msg,"#fff000"));
    break;
    case 2:
    CenterBroadcastCenter.addMsg(msg);
    break;
    case 3:
    CenterBroadcastDown.addMsg(msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    break;
    case 4:
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    break;
    case 5:
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_TEAM,Utils.fo nt("【HT】","#ff0000") + msg);
    break;
    case 6:
    this.writeMsg(ChatConstant.CHAT_TYPE_WORLD,Utils.f ont("【HT】","#ff0000") + msg);
    this.writeMsg(ChatConstant.CHAT_TYPE_GUILD,Utils.f ont("【HT】","#ff0000") + msg);
    break;
    case 7:
    this.writeMsg(ChatConstant.CHAT_TYPE_SPEAKER,Utils .font("【HT】","#ff0000") + msg);
    this.showSpeaker(Utils.font("【Loa】",Global.col orRgb[Global.COLOR_GOLD]) + msg);
    break;
    case 8:
    CenterBroadcastUp.addMsg(msg);
    break;
    case 9:
    CenterBroadcastCenter.addMsg(msg);
    break;
    case 10:
    SystemTip.addMsg(msg);
    break;
    case 11:
    WordTip.show(msg);
    break;
    case 12:
    CenterBroadcastDown.addMsg(msg);
    }
    }

    public function getMsgArray(type:int) : Array
    {
    var arr:Array = [];
    for(var i:int = 1; i < _msgArray[type].length; i++)
    {
    arr.push(_msgArray[type][i]);
    }
    return arr;
    }

    public function get input() : Text
    {
    return this._input;
    }

    public function set input(value:Text) : void
    {
    this._input = value;
    }

    override public function set visible(value:Boolean) : void
    {
    super.visible = value;
    }

    override public function onResize() : void
    {
    if(Global.stage.stageWidth - 1345 < 0)
    {
    x = 0;
    y = Global.stage.stageHeight - height - 90;
    }
    else
    {
    x = 0;
    y = Global.stage.stageHeight - height;
    }
    if(this.shen)
    {
    this.shen.y = int(Global.stage.stageHeight - 25);
    }
    }
    }
    }
    Mình sửa các kiểu vẫn không được, bác nào đi qua giúp với. Xin trả phí công fix chat có hiển thị dấu cách
    Link file: [Only registered and activated users can see links. ]
    Lần sửa cuối bởi nobitajx2, ngày 12-08-17 lúc 07:59 AM.
    Khách viếng thăm hãy cùng nobitajx2 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #2
    Thành Viên
    Ngày tham gia
    Aug 2013
    Bài viết
    282
    Thanks
    36
    Thanked 444 Times in 96 Posts

    Ðề: Vạn Giới Chibi

    [Only registered and activated users can see links. ]


    [Only registered and activated users can see links. ]
    Khách viếng thăm hãy cùng toandaik xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  3. Các thành viên gởi lời cảm ơn đến toandaik vì bài viết này !

    nobitajx2 (10-08-17)

  4. #3
    Thành Viên Tâm Huyết nobitajx2's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    1,275
    Thanks
    670
    Thanked 361 Times in 106 Posts

    Ðề: Vạn Giới Chibi

    Trích dẫn Gửi bởi toandaik [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]


    [Only registered and activated users can see links. ]
    Mong được chỉ giáo
    Khách viếng thăm hãy cùng nobitajx2 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  5. #4
    Thành Viên conan067's Avatar
    Ngày tham gia
    Apr 2014
    Bài viết
    93
    Thanks
    165
    Thanked 12 Times in 5 Posts

    Ðề: Vạn Giới Chibi

    Trích dẫn Gửi bởi toandaik [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]


    [Only registered and activated users can see links. ]
    Hướng dẫn chạy server với, không rành mấy cái này........???????
    Khách viếng thăm hãy cùng conan067 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  6. #5
    Thành Viên Tâm Huyết nobitajx2's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    1,275
    Thanks
    670
    Thanked 361 Times in 106 Posts

    Ðề: Vạn Giới Chibi

    Mong đc cao nhân đi qua chỉ giáo
    Khách viếng thăm hãy cùng nobitajx2 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  7. #6
    Thành Viên
    Ngày tham gia
    Dec 2015
    Bài viết
    44
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Ðề: Vạn Giới Chibi

    Trích dẫn Gửi bởi nobitajx2 [Only registered and activated users can see links. ]
    Mong đc cao nhân đi qua chỉ giáo
    Có ai chạy được để tìm hiểu đâu mà hỏi, bạn chạy được mà ỉm ỉm dùng 1 mình đem hút hít thì tự fix đi chứ ai rảnh đâu chưa biết gì cái game đó mà chỉ cho bạn fix
    Khách viếng thăm hãy cùng kgames xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  8. #7
    Thành Viên Tâm Huyết nobitajx2's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    1,275
    Thanks
    670
    Thanked 361 Times in 106 Posts

    Ðề: Vạn Giới Chibi

    Trích dẫn Gửi bởi kgames [Only registered and activated users can see links. ]
    Có ai chạy được để tìm hiểu đâu mà hỏi, bạn chạy được mà ỉm ỉm dùng 1 mình đem hút hít thì tự fix đi chứ ai rảnh đâu chưa biết gì cái game đó mà chỉ cho bạn fix
    Mình thấy cũng có nhiều bạn " Tay to " chạy được rồi, nhưng chắc do là chibi đồ họa không được đẹp lắm nên họ không chạy thôi, mình đang test thử thấy như vậy, mình lên hỏi, có trả phí hậu tạ chứ có hỏi không đâu.
    Khách viếng thăm hãy cùng nobitajx2 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  9. #8
    Thành Viên Tâm Huyết nobitajx2's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    1,275
    Thanks
    670
    Thanked 361 Times in 106 Posts

    Ðề: Vạn Giới Chibi

    Mình sửa các kiểu vẫn không được, bác nào đi qua giúp với. Xin trả phí công fix chat có hiển thị dấu cách
    Link file: [Only registered and activated users can see links. ]
    Khách viếng thăm hãy cùng nobitajx2 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  10. #9
    Thành Viên kenjidraw's Avatar
    Ngày tham gia
    Apr 2008
    Đang ở
    Forbidden Gate
    Bài viết
    289
    Thanks
    48
    Thanked 371 Times in 36 Posts

    Ðề: Vạn Giới Chibi

    Trích dẫn Gửi bởi nobitajx2 [Only registered and activated users can see links. ]
    Mình sửa các kiểu vẫn không được, bác nào đi qua giúp với. Xin trả phí công fix chat có hiển thị dấu cách
    Link file: [Only registered and activated users can see links. ]
    Hướng dẫn cài hay share máy ảo đi bạn, sẽ có 500 anh em vào giúp
    Khách viếng thăm hãy cùng kenjidraw xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

 

 

Các Chủ đề tương tự

  1. Vạn Giới Chibi
    Bởi trunggl81 trong diễn đàn CHUYÊN ĐỀ WEB GAMES
    Trả lời: 13
    Bài viết cuối: 07-09-17, 02:06 AM
  2. Share + review vạn giới chibi
    Bởi BanBanhQuay trong diễn đàn CHUYÊN ĐỀ WEB GAMES
    Trả lời: 17
    Bài viết cuối: 27-08-17, 09:43 PM
  3. Xin webgame dạng chibi
    Bởi herovn1994 trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 3
    Bài viết cuối: 01-10-14, 05:55 PM
  4. [Cần Source] Webgame Hero Chibi hoặc Cyber Monster 2
    Bởi meodj1790 trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 6
    Bài viết cuối: 11-04-14, 10:37 AM

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •  
Múi giờ GMT +7. Bây giờ là 03:41 PM.
vBulletin®, Copyright ©2000-2011, Jelsoft Enterprises Ltd.
CLBGamesVN không chịu trách nhiệm về Luật Bản Quyền của các tài liệu, bài viết v.v...được đăng tải trên diễn đàn này.
Diễn đàn phát triển dưới sự đóng góp của tất cả thành viên. BQT chỉ là những người thành lập ra sân chơi, quản lý và duy trì về mặt kỹ thuật, nội dung khi hợp lệ.