Sir,
I am Using AS 3 version in a project of Chat Room Development.I am Going in a step by step way by each Frame.
In the First frame I am Using the code
<code>
var smartFox:SmartFoxClient = new SmartFoxClient(true)
smartFox.addEventListener(SFSEvent.onConnection, onSFSConnection)
onSFSRoomListUpdate)
function onSFSConnection(evt:SFSEvent):void
{
trace("\nHHHHHHH\nBefore condition Point\nConnection succesful:", evt.params.success+"\nHHHHHHH\n")
if (evt.params.success){
smartFox.defaultZone="simpleChat";
smartFox.login(smartFox.defaultZone, myUsername, "")
mcp_Connect.txt_ConnectMSG.autoSize="left";
mcp_Connect.txt_ConnectMSG.text="Connection Successfull...!";
this.gotoAndPlay(2);
}else{
mcp_Connect.txt_ConnectMSG.autoSize="left";
mcp_Connect.txt_ConnectMSG.text="Connection is not established...!";
this.gotoAndStop(2);
}
trace("\nHHHHHHH\nAfter condition Point\nConnection succesful:", evt.params.success+"\nHHHHHHH\n")
}
smartFox.loadConfig("config/sfsClient.xml", true)
</code>
This is successfull., but in the Next Frame I designed a Form to enter name and Password. But,when I am Using the
<code>
smartFox.addEventListener(SFSEvent.onLogin, onSFSLogin)
function onSFSLogin(evt:SFSEvent):void
{
trace("Login succesful "+evt.params.success);
if (evt.params.success){
// myUsername = evt.params.name
trace("Login successfull with : "+evt.params.name);
this.gotoAndStop("JoinRoom");
}else{
trace(smartFox.myUserId+"\n"+smartFox.myUserName+"\nZone login error; the following error occurred: " + evt.params.error);
mcp_loginError.txt_LoginError.autoSize="left";
mcp_loginError.txt_LoginError.text=evt.params.error;
mcp_loginError.visible=true;
// fm.setFocus(txt_Login.text);
var fm1:FocusManager = new FocusManager(this);
fm1.setFocus(txt_Login);
}
}
btn_Submit.addEventListener(MouseEvent.CLICK, onLoginSubnitBtClick)
function onLoginSubnitBtClick(evt:MouseEvent):void
{
var arr_ERROR_MESSAGES:Array=new Array();
var arr_ERROR_FIELDS:Array=new Array();
// trace("Event "+evt.type);
if(txt_Login.text==""){
arr_ERROR_MESSAGES[arr_ERROR_MESSAGES.length]="Please enter Login Name.";
arr_ERROR_FIELDS[arr_ERROR_FIELDS.length]=txt_Login;
}
if(txt_Pwrd.text==""){
arr_ERROR_MESSAGES[arr_ERROR_MESSAGES.length]="Please enter User Password.";
arr_ERROR_FIELDS[arr_ERROR_FIELDS.length]=txt_Pwrd;
}
if(arr_ERROR_MESSAGES.length>0){
mcp_loginError.txt_LoginError.autoSize="left";
mcp_loginError.txt_LoginError.text=arr_ERROR_MESSAGES[0];
mcp_loginError.visible=true;
fm.setFocus(arr_ERROR_FIELDS[0]);
}else{
mcp_loginError.txt_LoginError.text="";
mcp_loginError.visible=false;
smartFox.defaultZone="simpleChat";
smartFox.login(smartFox.defaultZone, txt_Login.text, txt_Pwrd.text)
}
}
</code>
Smartfox is not allowing the new User, which has the name and Password from mY Login Form.
It is tracing the below Error :
<error>
Login succesful false
20
null
Zone login error; the following error occurred: User already logged in
</error>
from the Debug Window of Tracing action, I found that a user with unknown name and a numeric ID 20 was automatically Logged in.But what about my User to Join as Next User. Why The Srver is messaging
: User already logged in the Connection successfull Event
<TRACE>
HHHHHHH
Before condition Point
Connection succesful: true
HHHHHHH
[Sending]: <msg t='sys'><body action='login' r='0'><login z='simpleChat'><nick><![CDATA[null]]></nick><pword><![CDATA[]]></pword></login></body></msg>
HHHHHHH
After condition Point
Connection succesful: true
HHHHHHH
</TRACE>.
<observed>
While I am testing the Advanced TheoChat Example also, I found one Peculiar thing. There also I can only see My Logged in avathar.Not all the Logged avathars.How a multi user Chat can show only one User?
</observed>
<problem>
FOR my current Project, how could I proceed on to make my End users freely Logged in?
</problem>
- Board index SmartFoxServer Pro/Basic 1.x The Bug Trap
- Search
-
- It is currently 10 Feb 2026, 20:36
- All times are UTC
AS3 onLogin Event Failing
You think you've found a bug? Please report it here.
Jump to
- SmartFoxServer 2X
- ↳ SFS2X Questions
- ↳ SFS2X Client API
- ↳ SFS2X ActionScript 3 API
- ↳ SFS2X C# API
- ↳ SFS2X iPhone / iPad / OSX API
- ↳ SFS2X Java / Android API
- ↳ SFS2X HTML5 / JavaScript API
- ↳ SFS2X C++ API
- ↳ RedBox 2X
- ↳ 2X Features Wish List
- SmartFoxServer Pro/Basic 1.x
- ↳ SmartFoxServer 1.x Discussions and Help
- ↳ Server Side Extension Development
- ↳ BlueBox
- ↳ RedBox
- ↳ Features Wish List
- ↳ The Bug Trap
- ↳ Client API - SFS 1.x
- ↳ .Net / Unity3D API
- ↳ iPhone Objective-C API
- ↳ Silverlight API
- ↳ Java2SE / Android Client API
- ↳ Other Client API
- OpenSpace Support
- ↳ OpenSpace v2 discussions and help
- ↳ OpenSpace v1 discussions and help
- SmartFoxBits Support
- ↳ SmartFoxBits for SFS 2X
- ↳ SmartFoxBits for SFS 1.x
- Community
- ↳ Job offers and requests
- ↳ The Gallery