• Welcome to ForumKorner!
    Join today and become a part of the community.

Does any one know Flash?

AstriMc

Member
Reputation
0
Hey guys i am not sure if any of you are good with Flash but what i am trying to change Userlist Text Color in to Custom

and in php file i got its. like this

$adminColor = "#FF0000";
$modColor = "#FF6600";
$premiumColor = "#9966CC";
$userColor = "#0000FF";
$guestColor = "#000000";

now there is a file called userlist.as
Code:
import com.gchats.visichat.factory;
class com.gchats.visichat.clips.userlist extends MovieClip {
	private static var instanceObj = null;
	private var _visichat;
	private var _styles;
	private var _connector;
	private var _languages;
	private var _ObjEncoder;
	private var _opener;
	private var _config;
	private var _permissions;
	// private variables
	private var _users:Array;
	private var __width:Number;
	private var __height:Number;
	private var __item_width:Number = 90;
	private var __item_height:Number = 120;
	// 
	private var avatar_mode:Number = 1;
	private var UList:MovieClip;
	private var MAvatars:MovieClip;
	private var FList:MovieClip;
	private var IList:MovieClip;
	private var _userQueue:Array;
	private var _blockQueue:Array;
	private var _buddyQueue:Array;
	private var GCTabs:MovieClip;
	private var bottomTabs:MovieClip;
	private var trWidget:MovieClip;
	private var brWidget:MovieClip;
	private var _talker:String = "";
	private var _hands:Array;
	function userlist() {
		trace("userlist created");
		_visichat = factory.getClass("visichat");
		_styles = factory.getClass("styles");
		_connector = factory.getClass("connector");
		_config = factory.getClass("config");
		_languages = factory.getClass("languages");
		_ObjEncoder = factory.getClass("obj_encoder");
		_opener = factory.getClass("opener");
		_permissions = factory.getClass("permissions");
		instanceObj = this;
		init();
		this._visible = false;
		_userQueue = new Array();
		_blockQueue = new Array();
		_buddyQueue = new Array();
		_hands = new Array();
	}
	private function init() {
		__width = this._width;
		__height = this._height;
		userView(avatar_mode);
		_users = new Array();
		if (__width<120) {
			__width = 120;
		}
		this._xscale = this._yscale=100;
		__item_height += 5;
		__item_width += 5;
	}
	function onLoad() {
		this._y = factory.getClass("layout").getWidgetHeight("tr")+2;
		if (_config.getValue("styles_show_textchat") == "no") {
			var w:Number = Stage.width;
			if (w<310) {
				w = 310;
			}
			this._x = 198;
			this.setSize(w-210,factory.getClass("layout").getHeight("userlist"));
			trWidget.setSize(w-210,factory.getClass("layout").getWidgetHeight("tr"));
			brWidget.setSize(w-210,factory.getClass("layout").getWidgetHeight("br"));
		} else {
			this._x = _config.width-235;
			this.setSize(230,factory.getClass("layout").getHeight("userlist"));
			trWidget.setSize(230,factory.getClass("layout").getWidgetHeight("tr"));
			brWidget.setSize(230,factory.getClass("layout").getWidgetHeight("br"));
		}
		trWidget._y = -this._y+2;
		UList.itemRollOver = function(data:Object) {
			var _userinfo = factory.getClass("userinfo");
			data["profile"]["pic"] = data["picture"];
			_userinfo.show(data["profile"]);
		};
		UList.itemRollOut = function(data:Object) {
			var _userinfo = factory.getClass("userinfo");
			_userinfo.hide();
		};
		UList.onSelect = function(data:Object) {
			_parent.showPM(data["data"],true);
		};
		FList.onSelect = function(data:Object) {
			_parent.showPM(data["data"],true);
		};
		FList.itemRollOver = function(data:Object) {
			var _userinfo = factory.getClass("userinfo");
			data["profile"]["pic"] = data["picture"];
			_userinfo.show(data["profile"]);
		};
		FList.itemRollOut = function(data:Object) {
			var _userinfo = factory.getClass("userinfo");
			_userinfo.hide();
		};
		UList.sortFunction = function(list:Array) {
			list.sort(1);
			// Move up admin and moderators
			for (var j = 0; j<list.length; j++) {
				for (var i = 0; i<list.length-1; i++) {
					if (list[i+1][1]["profile"]["user_type"] == "mod" && list[i][1]["profile"]["user_type"] != "mod") {
						var l:Array = list[i+1];
						list[i+1] = list[i];
						list[i] = l;
					}
				}
			}
			for (var j = 0; j<list.length; j++) {
				for (var i = 0; i<list.length-1; i++) {
					if (list[i+1][1]["profile"]["user_type"] == "admin" && list[i][1]["profile"]["user_type"] != "admin") {
						var l:Array = list[i+1];
						list[i+1] = list[i];
						list[i] = l;
					}
				}
			}
			return list;
		};
		FList.sortFunction = function(list:Array) {
			list.sort(1);
			for (var j = 0; j<list.length; j++) {
				for (var i = 0; i<list.length-1; i++) {
					if (list[i+1][1]["profile"]["is_online"] == "yes" && list[i][1]["profile"]["is_online"] != "yes") {
						var l:Array = list[i+1];
						list[i+1] = list[i];
						list[i] = l;
					}
				}
			}
			return list;
		};
		GCTabs.addItem({data:"menu1", label:_languages.translate("userlist")});
		if (_config.getValue("avatarlist") != "no") {
			GCTabs.addItem({data:"menu2", label:_languages.translate("avatarlist")});
		}
		if (_config.getValue("show_member_list") != "no") {
			GCTabs.addItem({data:"menu3", label:_languages.translate("memberslist")});
		}
		GCTabs.selectedItem = "menu1";
		GCTabs.onSelect = function(data:Object) {
			if (data.data == "menu1") {
				_parent.userView(1);
			}
			if (data.data == "menu2") {
				_parent.userView(2);
			}
			if (data.data == "menu3") {
				_parent.userView(3);
			}
		};
		bottomTabs.addItem({data:"menu4", label:_languages.translate("buddy_list")});
		bottomTabs.addItem({data:"menu5", label:_languages.translate("block_list")});
		bottomTabs.selectedIndex = -1;
		bottomTabs.onSelect = function(data:Object) {
			if (data.data == "menu4") {
				_parent.userView(4);
			}
			if (data.data == "menu5") {
				_parent.userView(5);
			}
		};
		setStyles();
		setInterval(this,"showUser",50);
		updateAfterEvent();
		loadWidgets();
	}
	public function setSize(nW:Number, nH:Number) {
		var _current_room = factory.getClass("roomlist")._current_room;
		if (_config.getValue("styles_show_textchat") == "no") {
			trWidget.setSize(nW,factory.getClass("layout").getWidgetHeight("tr", _current_room));
			brWidget.setSize(nW,factory.getClass("layout").getWidgetHeight("br", _current_room));
		}
		__width = Math.floor(nW);
		__height = factory.getClass("layout").getHeight("userlist", _current_room);
		brWidget._y = __height+28;
		UList.setSize(__width,__height-32);
		FList.setSize(__width,__height-32);
		this["memberlist"].setSize(__width,__height-32);
		IList.setSize(__width,__height-32);
		if (_config.getValue("avatarlist") != "no") {
			MAvatars.setSize(__width,__height-32);
		}
		bottomTabs._y = __height-2;
		GCTabs.setSize(__width,27);
		bottomTabs.setSize(__width,27);
	}
	private function loadWidgets() {
		var _current_room = factory.getClass("roomlist")._current_room;
		var trWidgetObj = factory.getClass("layout").getWidget("tr", _current_room);
		var brWidgetObj = factory.getClass("layout").getWidget("br", _current_room);
		this._y = factory.getClass("layout").getWidgetHeight("tr", _current_room)+2;
		if (_config.getValue("styles_show_textchat") == "no") {
			var w:Number = Stage.width;
			if (w<310) {
				w = 310;
			}
			this._x = 198;
			this.setSize(w-210,factory.getClass("layout").getHeight("userlist", _current_room));
			trWidget.setSize(w-210,factory.getClass("layout").getWidgetHeight("tr", _current_room));
			brWidget.setSize(w-210,factory.getClass("layout").getWidgetHeight("br", _current_room));
		} else {
			this._x = _config.width-235;
			this.setSize(230,factory.getClass("layout").getHeight("userlist", _current_room));
			trWidget.setSize(230,factory.getClass("layout").getWidgetHeight("tr", _current_room));
			brWidget.setSize(230,factory.getClass("layout").getWidgetHeight("br", _current_room));
		}
		trWidget._y = -this._y+2;
		if (trWidgetObj != undefined) {
			if (_current_room == trWidgetObj["room"] || trWidgetObj["room"] == "0") {
				if (trWidget.path != _config.getValue("visichat_path")+"widgets/"+trWidgetObj["name"]) {
					trWidget._widget = trWidgetObj;
					trWidget.path = _config.getValue("visichat_path")+"widgets/"+trWidgetObj["name"];
				}
			} else {
				trWidget.path = "";
				trWidget.destroy();
			}
		} else {
			trWidget.path = "";
			trWidget.destroy();
		}
		if (brWidgetObj != undefined) {
			if (_current_room == brWidgetObj["room"] || brWidgetObj["room"] == "0") {
				if (brWidget.path != _config.getValue("visichat_path")+"widgets/"+brWidgetObj["name"]) {
					brWidget._widget = brWidgetObj;
					brWidget.path = _config.getValue("visichat_path")+"widgets/"+brWidgetObj["name"];
				}
			} else {
				brWidget.path = "";
				brWidget.destroy();
			}
		} else {
			brWidget.path = "";
			brWidget.destroy();
		}
	}
	public function onUserlist(result:Object) {
		reset();
		GCTabs.selectedItem = "menu1";
		for (var i in result) {
			addUser(result[i]["username"],result[i]);
		}
		_userQueue.sort(1);
		for (var j = 0; j<_userQueue.length; j++) {
			for (var i = 0; i<_userQueue.length-1; i++) {
				if (_userQueue[i+1][1]["user_type"] == "mod" && _userQueue[i][1]["user_type"] != "mod") {
					var l:Array = _userQueue[i+1];
					_userQueue[i+1] = _userQueue[i];
					_userQueue[i] = l;
				}
			}
		}
		for (var j = 0; j<_userQueue.length; j++) {
			for (var i = 0; i<_userQueue.length-1; i++) {
				if (_userQueue[i+1][1]["user_type"] == "admin" && _userQueue[i][1]["user_type"] != "admin") {
					var l:Array = _userQueue[i+1];
					_userQueue[i+1] = _userQueue[i];
					_userQueue[i] = l;
				}
			}
		}
	}
	public function onJoin(result:Object) {
		/*
		 * result values:
		 * result["username"]
		 * result["room"]
		 * result["profile"]
		 */

		if (!user_exists(result["username"])) {
			addUser(result["username"],result["profile"]);
		} else {
			changeUser(result["username"],result["profile"]);
		}
		if (result["profile"]["invisible"] != "yes") {
			this["memberlist"].onJoin(result["username"]);
		}
		loadWidgets();
	}
	public function onLeave(result:Object) {
		/*
		 * result values:
		 * result["username"]
		 * result["room"]
		 */
		if (result["reason"] == "dc") {
			this["memberlist"].onLeave(result["username"]);
			FList.changeItem(result["username"],{is_online:"0"});
		}
		if (user_exists(result["username"])) {
			removeUser(result["username"]);
		}
		onEqualizer(result["username"],0);
	}
	public function onMemberConnect(username:String, connected:Boolean) {
		if (connected) {
			this["memberlist"].onJoin(username);
			FList.changeItem(username,{is_online:"1"});
		} else {
			this["memberlist"].onLeave(username);
			FList.changeItem(username,{is_online:"0"});
		}
	}
	public function show() {
		if (_config.getValue("enable_one_way_chat") != "yes") {
			this._visible = true;
			factory.getClass("mediaPlayer").show();
		}
	}
	public function hide() {
		reset();
		this._visible = false;
		trWidget.path = "";
		brWidget.path = "";
		trWidget.destroy();
		brWidget.destroy();
		factory.getClass("mediaPlayer").hide();
	}
	private function addUser(username:String, _profile:Object) {
		// add user to the beginig of the queue if user is moderator or admin
		if (_profile["user_type"] == "admin" || _profile["user_type"] == "mod") {
			_userQueue.unshift(Array(username, _profile));
		} else {
			_userQueue.push(Array(username, _profile));
		}
	}
	private function showUser() {
		if (_userQueue.length>0) {
			if ((!isNaN(_config.getValue("max_user_list_size")) && _config.getValue("max_user_list_size")>0 && _users.length<_config.getValue("max_user_list_size")) || isNaN(_config.getValue("max_user_list_size")) || _config.getValue("max_user_list_size") == 0 || (_userQueue[0][1]["user_type"] == "mod" || _userQueue[0][1]["user_type"] == "admin")) {
				var tmpU = _userQueue.shift();
				var username:String = tmpU[0];
				var _profile:Object = tmpU[1];
				if (username == undefined || _profile == undefined) {
					return;
				}
				if (!user_exists(username)) {
					if (_profile["invisible"] == "no" || _connector._is_administrator || (_connector._allow_invisible == "yes" && _profile["user_type"] != "admin")) {
						var picture:String = _config.getPicture(_profile["pic"], _profile["gender"]);
						var thumbnail:String = _config.getThumbnail(_profile["pic"], _profile["gender"]);
						// if user is already talking
						var talk:String = _profile["talk"];
						if (talk == "100") {
							factory.getClass("public_voices").onEqualizer(username,"100");
						}
						UList.addItem({data:username, label:username, profile:_profile, picture:picture, thumbnail:thumbnail, talk:talk});
						if (_config.getValue("avatarlist") != "no") {
							MAvatars.addItem({data:username, label:username, profile:_profile, picture:picture, thumbnail:thumbnail, talk:talk});
						}
						if (_config.getValue("open_all_cam_on_login") == "yes") {
							if (_profile["cam"] == "yes") {
								factory.getClass("opener").showWebCam(username);
							}
						}
						_users.push(username);
					}
				}
			}
		}
		if (_blockQueue.length>0) {
			var tmpU = _blockQueue.shift();
			IList.addItem({data:tmpU, label:tmpU});
		}
		if (_buddyQueue.length>0) {
			var tmpU = _buddyQueue.shift();
			var _prof:Object = new Object();
			_prof["username"] = tmpU[0];
			_prof["pic"] = tmpU[2];
			var picture:String = _config.getPicture(_prof["pic"], _prof["gender"]);
			var thumbnail:String = _config.getThumbnail(_prof["pic"], _prof["gender"]);
			FList.addItem({data:tmpU[0], label:tmpU[0], profile:_prof, picture:picture, thumbnail:thumbnail, approved:tmpU[1]});
			_connector.is_online(tmpU[0]);
		}
	}
	public function onAway(result:Object) {
		var awayValue = result["message"]["value"];
		UList.changeItem(result["username"],{away:awayValue});
	}
	public function onTyping(username:String, typing:String) {
		UList.changeItem(username,{away:"no", typing:typing});
	}
	public function onWatch(username:String, _watch:String) {
		UList.changeItem(username,{watch:_watch});
	}
	public function disAllowCam(username:String) {
		factory.getClass("userProfile").delViewer(username);
		var msg:Object = new Object();
		msg["type"] = "watchCam";
		msg["status"] = "close";
		_connector.send_private(username,_ObjEncoder.Obj2XML(msg),'');
	}
	private function removeUser(username:String) {
		UList.removeItem(username);
		if (_config.getValue("avatarlist") != "no") {
			MAvatars.removeItem(username);
		}
		for (var i = 0; i<_users.length; i++) {
			if (_users[i] == username) {
				_users.splice(i,1);
			}
		}
		for (var i = 0; i<_userQueue.length; i++) {
			if (_userQueue[i][0] == username) {
				_userQueue.splice(i,1);
			}
		}
	}
	public function setProperty(username:String, properties:Object) {
		var profile:Object = UList.getItem(username);
		for (var i in properties) {
			profile["profile"][i] = properties[i];
		}
		UList.changeItem(username,{profile:profile["profile"]});
	}
	private function changeUser(username:String, _profile:Object) {
		if (_profile["invisible"] == "no" || _connector._is_administrator || (_connector._allow_invisible == "yes" && _profile["user_type"] != "admin")) {
			var picture:String = _config.getPicture(_profile["pic"], _profile["gender"]);
			var thumbnail:String = _config.getThumbnail(_profile["pic"], _profile["gender"]);
			UList.changeItem(username,{data:username, label:username, profile:_profile, picture:picture, thumbnail:thumbnail});
			FList.changeItem(username,{data:username, label:username, profile:_profile, picture:picture, thumbnail:thumbnail});
			if (_config.getValue("avatarlist") != "no") {
				MAvatars.changeItem(username,{data:username, label:username, profile:_profile, picture:picture, thumbnail:thumbnail});
			}
		}
	}
	public function user_in_room(username:String) {
		for (var i = 0; i<_userQueue.length; i++) {
			if (_userQueue[i][0] == username) {
				return true;
			}
		}
		return user_exists(username);
	}
	private function user_exists(username:String) {
		for (var i in _users) {
			if (_users[i] == username) {
				return true;
			}
		}
		return false;
	}
	public function userView(value:Number) {
		if (value != avatar_mode) {
			var _userinfo = factory.getClass("userinfo");
			_userinfo.hide();
		}
		avatar_mode = value;
		if (avatar_mode == 1) {
			hidePanels();
			UList._visible = true;
		}
		if (avatar_mode == 2) {
			hidePanels();
			MAvatars._visible = true;
		}
		if (avatar_mode == 3) {
			hidePanels();
			this.attachMovie("memberlist","memberlist",this.getNextHighestDepth());
			this["memberlist"]._y = 29;
			this["memberlist"].setSize(__width,__height-32);
		}
		if (avatar_mode == 4) {
			hidePanels();
			FList._visible = true;
		}
		if (avatar_mode == 5) {
			hidePanels();
			IList._visible = true;
		}
		if (value<4) {
			bottomTabs.deSelectAll();
		} else {
			GCTabs.selectedIndex = -1;
		}
	}
	private function hidePanels() {
		this["memberlist"].swapDepths(2005);
		this["memberlist"].removeMovieClip();
		UList._visible = false;
		MAvatars._visible = false;
		IList._visible = false;
		FList._visible = false;
	}
	public function show_gallery_window(username) {
		factory.getClass("opener").showGallery(username);
	}
	public function ignore_voice(username:String, ignore:Boolean) {
		factory.getClass("public_voices").ignore(username,ignore);
	}
	private function setStyles() {
		if (_styles.getColor("userlist_bg") != undefined) {
			UList.backgroundColor = _styles.getColor("userlist_bg");
			FList.backgroundColor = _styles.getColor("userlist_bg");
			IList.backgroundColor = _styles.getColor("userlist_bg");
		}
		if (_styles.getColor("userlist_rollOver") != undefined) {
			UList.itemRollOverColor = _styles.getColor("userlist_rollOver");
			FList.itemRollOverColor = _styles.getColor("userlist_rollOver");
			IList.itemRollOverColor = _styles.getColor("userlist_rollOver");
		}
		if (_styles.getColor("userlist_text") != undefined) {
			UList.textColor = _styles.getColor("userlist_text");
			FList.textColor = _styles.getColor("userlist_text");
			IList.textColor = _styles.getColor("userlist_text");
		}
		if (_styles.getColor("avatars_bg") != undefined) {
			MAvatars.backgroundColor = _styles.getColor("avatars_bg");
		}
		if (_styles.getColor("avatars_border_bg") != undefined) {
			MAvatars.itemRollOverColor = _styles.getColor("avatars_border_bg");
		}
		if (_config.getValue("styles_alpha") != undefined && !isNaN(_config.getValue("styles_alpha"))) {
			MAvatars.backgroundAlpha = _config.getValue("styles_alpha");
			UList.backgroundAlpha = _config.getValue("styles_alpha");
			FList.backgroundAlpha = _config.getValue("styles_alpha");
			IList.backgroundAlpha = _config.getValue("styles_alpha");
		}
		if (_styles.getColor("scrollbar_bg_color") != undefined) {
			UList.scrollbarBGColor = _styles.getColor("scrollbar_bg_color");
			IList.scrollbarBGColor = _styles.getColor("scrollbar_bg_color");
			FList.scrollbarBGColor = _styles.getColor("scrollbar_bg_color");
			MAvatars.scrollbarBGColor = _styles.getColor("scrollbar_bg_color");
		}
		if (_styles.getColor("scrollbar_color") != undefined) {
			UList.scrollbarColor = _styles.getColor("scrollbar_color");
			IList.scrollbarColor = _styles.getColor("scrollbar_color");
			FList.scrollbarColor = _styles.getColor("scrollbar_color");
			MAvatars.scrollbarColor = _styles.getColor("scrollbar_color");
		}
		if (_styles.getColor("scrollbar_arrow") != undefined) {
			UList.scrollbarArrowColor = _styles.getColor("scrollbar_arrow");
			IList.scrollbarArrowColor = _styles.getColor("scrollbar_arrow");
			FList.scrollbarArrowColor = _styles.getColor("scrollbar_arrow");
			MAvatars.scrollbarArrowColor = _styles.getColor("scrollbar_arrow");
		}
		if (_styles.getColor("userlist_tab_bg") != undefined) {
			bottomTabs.backgroundColor = _styles.getColor("userlist_tab_bg");
			GCTabs.backgroundColor = _styles.getColor("userlist_tab_bg");
		}
		if (_styles.getColor("userlist_tab_text") != undefined) {
			bottomTabs.textColor = _styles.getColor("userlist_tab_text");
			GCTabs.textColor = _styles.getColor("userlist_tab_text");
		}
		if (_styles.getColor("userlist_tab_selected_text") != undefined) {
			bottomTabs.selectedTextColor = _styles.getColor("userlist_tab_selected_text");
			GCTabs.selectedTextColor = _styles.getColor("userlist_tab_selected_text");
		}
		if (_styles.getColor("userlist_tab_line") != undefined) {
			bottomTabs.lineColor = _styles.getColor("userlist_tab_line");
			GCTabs.lineColor = _styles.getColor("userlist_tab_line");
		}
	}
	public function clearList() {
		IList.removeAll();
		FList.removeAll();
		_blockQueue = new Array();
		_buddyQueue = new Array();
	}
	// Block List
	public function isBlocked(username:String) {
		for (var i = 0; i<_blockQueue.length; i++) {
			if (_blockQueue[i] == username) {
				return true;
			}
		}
		return IList.itemExists(username);
	}
	public function addBlock(username:String) {
		_blockQueue.push(username);
	}
	// Block user
	public function onBlock(username:String) {
		if (isBlocked(username)) {
			factory.getClass("error").showError(_languages.translate("already_blocked"),true);
			return;
		}
		if (_connector._username == username) {
			factory.getClass("error").showError(_languages.translate("cant_block_yourself"),true);
			return;
		}
		if (_connector._guest) {
			factory.getClass("error").showError(_languages.translate("guest_cant_block"),true);
			return;
		}
		com.gchats.visichat.core.save("block",{sender:username});
		_connector.block(username,"yes");
	}
	public function onBlockResult(result:String, username:String) {
		if (result == "success") {
			IList.addItem({data:username, label:username});
			factory.getClass("error").showError(_languages.translate("user_blocked", username),true);
		}
		if (result == "moderator") {
			factory.getClass("error").showError(_languages.translate("block_moderator"),true);
		}
		if (result == "already") {
			factory.getClass("error").showError(_languages.translate("already_blocked"),true);
		}
	}
	// UnBlock user
	public function unBlock(username:String) {
		if (!isBlocked(username)) {
			factory.getClass("error").showError(_languages.translate("block_not_exists", username),true);
			return;
		}
		if (_connector._guest) {
			factory.getClass("error").showError(_languages.translate("guest_cant_block"),true);
			return;
		}
		com.gchats.visichat.core.save("unblock",{sender:username});
		IList.removeItem(username);
		factory.getClass("error").showError(_languages.translate("user_unblocked", username),true);
		_connector.block(username,"no");
	}
	// Add Buddy
	public function addBuddy(username:String) {
		if (hasBuddy(username)) {
			factory.getClass("error").showError(_languages.translate("already_added_buddy"),true);
			return;
		}
		if (_connector._guest) {
			factory.getClass("error").showError(_languages.translate("guest_cant_add"),true);
			return;
		}
		com.gchats.visichat.core.save("addbuddy",{sender:username});
		_connector.askBuddyPermission(username);
		onBuddyAdd(username);
	}
	// Delete buddy
	public function delBuddy(username:String) {
		if (!hasBuddy(username)) {
			factory.getClass("error").showError(_languages.translate("buddy_not_exists"),true);
			return;
		}
		if (_connector._guest) {
			factory.getClass("error").showError(_languages.translate("guest_cant_add"),true);
			return;
		}
		var C = factory.getClass("opener").confirm(username, "delbuddy");
		C["owner"] = this;
		C.setLabel("delBuddy",_languages.translate("del_buddy_confirm", username),_languages.translate("sure"));
		C.onAccept = function() {
			factory.getClass("error").showError(this["owner"]._languages.translate("buddy_removed", username),true);
			com.gchats.visichat.core.save("delbuddy",{sender:username});
			this["owner"].removeBuddy(username);
			this["owner"]._connector.removeBuddy(username);
		};
	}
	// Buddy List
	public function onBuddyAdd(username:String) {
		_buddyQueue.push(Array(username, 0, ''));
		factory.getClass("error").showError(_languages.translate("buddy_added", username),true);
	}
	public function hasBuddy(username:String) {
		for (var i = 0; i<_buddyQueue.length; i++) {
			if (_buddyQueue[i] == username) {
				return true;
			}
		}
		return FList.itemExists(username);
	}
	public function addBuddyUser(username:String, approved:String, picture:String) {
		_buddyQueue.push(Array(username, approved, picture));
	}
	public function onDelBuddy(username:String) {
		removeBuddy(username);
		factory.getClass("error").showError(_languages.translate("buddy_removed", username),true);
	}
	public function removeBuddy(username:String) {
		FList.removeItem(username);
	}
	public function approveBuddy(username:String, picture:String) {
		var _profile:Object = FList.getItem(username);
		_profile["profile"]["pic"] = picture;
		_profile["profile"]["username"] = username;
		var picture:String = _config.getPicture(picture, _profile["profile"]["gender"]);
		var thumbnail:String = _config.getThumbnail(picture, _profile["profile"]["gender"]);
		FList.changeItem(username,{username:username, is_online:"1", approved:1, picture:picture, thumbnail:thumbnail});
	}
	public function onIsOnline(username:String, isOnline:Boolean, _profile:Object) {
		if (isOnline) {
			FList.changeItem(username,{is_online:"1", profile:_profile});
		} else {
			FList.changeItem(username,{is_online:"0"});
		}
	}
	private function showPM(username:String) {
		_opener.showPM(username,true);
	}
	public function isWatching(username:String) {
		return factory.getClass("userProfile").isWatching(username);
	}
	public function reset() {
		_userQueue = new Array();
		UList.removeAll();
		if (_config.getValue("avatarlist") != "no") {
			MAvatars.removeAll();
		}
		_users = new Array();
		_hands = new Array();
		userView(1);
		GCTabs.selectedIndex = 0;
		bottomTabs.selectedIndex = -1;
	}
	/*
	* Talking functions
	*/
	public function onEqualizer(username:String, value:Number) {
		UList.changeItem(username,{talk:value});
	}
	/*
	* when a user raise hand in the room
	*/
	public function onRaiseHand(username:String, raise:String) {
		factory.getClass("public_voices").removeUser(username);
		if (raise == "yes") {
			this.setProperty(username,{mic:"hand"});
		} else {
			this.setProperty(username,{mic:"no"});
		}
	}
	/*
	*
	*/
	public function onRoomMicChange(username:String) {
		for (var i = 0; i<UList.length; i++) {
			var profile:Object = UList.getItemAt(i);
			if (profile["data"] == username) {
				this.setProperty(profile["data"],{mic:"yes"});
			} else {
				if (profile["profile"]["mic"] == "yes") {
					this.setProperty(profile["data"],{mic:"no"});
				}
			}
		}
	}
	/*
	* Take or give mic to given username
	*/
	public function takeMic(username:String, action:String) {
		trace("take mic" + username);
		_connector.takeMic(username,action);
	}
	public function getRoomList() {
		return factory.getClass("roomlist");
	}
	public function kickRoom(username:String) {
		_connector.kickRoom(username);
	}
	public static function getInstance():userlist {
		if (instanceObj == null) {
			instanceObj = new userlist();
		}
		return instanceObj;
	}
}

i know that i need to create public function or use existing

can some one help figure out where i do the changes thanks


Never Mind i fixed it ..
 
Top