-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
As I am working through converting one of my applications to Flex/FMS
I have one small issue which does not produce the same results for the
1st person that enters the application. Within my viewStack I have a
textArea and a List which is being populated from information that is
retrieved from a Remote Shared Object.

When I run the application from FlexBuilder sometimes I get an
TypeError: Error #1009: Cannot access a property or method of a null
object reference which occurs on line 163 of my application. When I
get this error message, then the mx:List is populated with all
usernames of the users who are connected to the application and the
mx:TextArea is blank. If I do not get the Error Message then the
mx:List box does not have any usernames within it however the
mx:TextArea has the correct information within it.

The mx:List has a dataProvider of {chatPeopleListDP} and a labelField
of UserName

below is the code sections:

[Bindable] private var chatPeopleListDP:Array = new Array();


private function NetStatusHandler(event:NetStatusEvent):void {
    switch (event.info.code) {
      case "NetConnection.Connect.Success":
        HomeworkChatViewStack.selectedChild=ChatWindow;
        UsersListSO = SharedObject.getRemote("ChatUsers",
ChatServer_nc.uri, false);
        UsersListSO.addEventListener(SyncEvent.SYNC, SyncUserList);
        UsersListSO.connect(ChatServer_nc);

        ChatHistorySO = sharedObject.getRemote("ChatHistory",
ChatServer_nc.uri, false);
        ChatHistorySO.addEventListener(SyncEvent.SYNC,
SyncClientMsgHistory);
        ChatHistorySO.connect(ChatServer_nc);
        break;
      {Other Case Statements for NetConnection.Connect.Rejected,
Closed, Failed}
}

private function SyncClientMsgHistory(event:SyncEvent):void {
    TextChatWindow.htmlText += event.target.data['ChatSession'];
}

private function SyncUserList(event:SyncEvent):void {
    var tempList:Object = new Object();
    for (var i:String in event.target.data) {
        tempList.UserName = event.target.data[i]['UserName'];
       tempList.IP = event.target.data[i]['ip'];
       chatPeopleListDP.push(tempList);
    }
}


Can anyone see why only one of these Sync Method is executing when a
user enters the application.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (MingW32)
Comment: GnuPT 2.6.2.1 by EQUIPMENTE.DE
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iQEVAwUBRxTKTXnjLHMPlkANAQLaBwf/VTEKF7ua+GvffqlJr28UD/+1JEOdfnw0
1bqs+nqaTK7PCo9zQkmWkpjRrY3b7xhqcBUN2tuSw9A0Oplb8ll3Kfeb8T/S30wI
B1hT+F58IRaulSzSDLpbmYxGqDkvD1d1ysvB4d8XPhzBvPVkq+n9gXl4oJQlq/YM
sOABra3tFymoMfvC04YfgccMSORlK2r204eOnB7j8T6POiVfOBQrGYRhmO6vv3B4
lH+yYVx3RqkQqvDCQuBU0hf+yUDtkaFUicJ78SuyLOkq3iO3+fpHLCkuTcs4sH1R
YqMn9i22N2uh7bdL+FlBtL2ZaQeRdstUEWCA/6/5hHn6zRnEsE+Xog==
=dAhu
-----END PGP SIGNATURE-----


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to