Index: pro-violet-viettel/refs/LectureEditor/menus.as
===================================================================
--- pro-violet-viettel/refs/LectureEditor/menus.as	(revision 297)
+++ pro-violet-viettel/refs/LectureEditor/menus.as	(revision 698)
@@ -402,5 +402,4 @@
 
 function ClearAllData() {
-	dataXML.firstChild.removeNode();
 	movScene.ClearBackGround();
 	while (movScene.bkgnd_node.childNodes.length > 0) movScene.bkgnd_node.lastChild.removeNode();
@@ -565,4 +564,5 @@
 			function(param) {
 				ClearAllData();
+				
 				currentFile = param.id;
 				fscommand("Set Title", param.name);
@@ -587,4 +587,18 @@
 		}
 	});
+}
+
+// open from Violet Space (using HMTL/javascript to display folders & files)
+// when user clicked a file in Violet Space, a new window (which contains the lecture editor client) will be opened; ID of the selected lecture will be passed via flashvar
+function OpenFileById() {
+	clearInterval(_root.openFileInterval);
+	
+	if (fileId == undefined) return;
+	if (fileId == "") return;
+	
+	//ShowGrayScreen();
+	ClearAllData();
+	currentFile = fileId;
+	LoadXMLData(spaceUrl + "file?id="+fileId+"&userid="+userId);
 }
 
@@ -1100,9 +1114,47 @@
 }
 
-// Thay cho phần LoginViolet:
-dataXML.firstChild.attributes.Info = unescape(appUserName) + " - " + unescape(appAddress);
-dataXML.firstChild.attributes.Check = dataXML.firstChild.attributes.Info.length + 13;
-movScene.movTemplate.userInfo = movDefLayout.userInfo = dataXML.firstChild.attributes.Info;
-licenseInfo = {type: licType, customer: licCustomer, create: licCreate, expire: licExpire}
+// load user info
+function LoadUserInfo() {
+	// gray screen
+	ShowGrayScreen();
+	
+	// load user info
+	var xml_userinfo:XML = new XML();
+	xml_userinfo.ignoreWhite = true;
+	
+	xml_userinfo.onLoad = function(success) {
+		// hide gray screen
+		ShowGrayScreen(false);
+		
+		// user data
+		var attr:Object = this.firstChild.firstChild.attributes;
+		userId = attr.userId;
+		userLevel = attr.userLevel;
+		userPhone = attr.userPhone;
+		userMoney = attr.userMoney;
+		appUserName = attr.appUserName;
+		appAddress = attr.appAddress;
+		dataXML.firstChild.attributes.Info = unescape(appUserName) + " - " + unescape(appAddress);
+		dataXML.firstChild.attributes.Check = dataXML.firstChild.attributes.Info.length + 13;
+		movScene.movTemplate.userInfo = movDefLayout.userInfo = dataXML.firstChild.attributes.Info;
+		licenseInfo = { type: attr.licType, customer: attr.licCustomer, create: attr.licCreate, expire: attr.licExpire }
+		
+		//
+		if (fileId != undefined) {
+			_root.openFileInterval = setInterval(OpenFileById, 1000);
+		}
+	}
+	
+	var str:String = (host == undefined) ? userInfoUrl : (host + userInfoUrl);
+	xml_userinfo.load(str);
+}
+
+// Nếu user info được lấy theo cách truyền từ flashvars:
+function UpdateFromFlashVars() {
+	dataXML.firstChild.attributes.Info = unescape(appUserName) + " - " + unescape(appAddress);
+	dataXML.firstChild.attributes.Check = dataXML.firstChild.attributes.Info.length + 13;
+	movScene.movTemplate.userInfo = movDefLayout.userInfo = dataXML.firstChild.attributes.Info;
+	licenseInfo = {type: licType, customer: licCustomer, create: licCreate, expire: licExpire}
+}
 
 
Index: pro-violet-viettel/refs/LectureEditor/scene.as
===================================================================
--- pro-violet-viettel/refs/LectureEditor/scene.as	(revision 297)
+++ pro-violet-viettel/refs/LectureEditor/scene.as	(revision 698)
@@ -50,4 +50,6 @@
 userUrl = "http://api.violet.vn/user/";
 spaceUrl = "http://api.violet.vn/space/";
+userInfoUrl = "/ajax/user/login/xml"; // the server domain/IP will be passed via flashvars 
+//online = true; fileId = 2877; userInfoUrl = "userinfo.xml"; // TEST
 userId = 0;
 
@@ -258,4 +260,9 @@
 		AutoCheckVersion();
 		//if (online && userId==0) LoginViolet();
+		if (online && userId == 0) {
+			LoadUserInfo();
+		} else {
+			UpdateFromFlashVars();
+		}
 	}
 	loadVariables(appPath + "Language" + slash + language + ".txt", lang);
@@ -408,4 +415,5 @@
 function onLoadData(success)
 {
+	//ShowGrayScreen(false);
 	if( !success ) {
 		ErrorMessage(lang.msgOpenError);
