Hello Everyone,I'm having an issue with setting up a test Chat client. I
can login to the AFCS air app as the developer and I can login with my
Flex sample. However, when I change my
AdobeHSAuthenticator.authenticator.userName to Guest and set the
password = null, I receive an "Error #1009: Cannot access a property or
method of a null object reference." FlashDevelop is pointing to the
sendMessage method and the clear method of the SimpleChatModel
Object.Any Ideas? Thanks in Advance import
com.adobe.rtc.sharedModel.descriptors.ChatMessageDescriptor; import
com.adobe.rtc.session.ConnectSessionContainer; import
com.adobe.rtc.events.ChatEvent; import
com.adobe.rtc.sharedModel.SimpleChatModel; import
com.adobe.rtc.events.AuthenticationEvent; import
com.adobe.rtc.authentication.AdobeHSAuthenticator; import
com.adobe.rtc.events.SessionEvent; import flash.ui.Keyboard; import
mx.controls.Alert; import flash.events.*; // this simple example just
shows how this shared model can be made easily binable for MXML. // See
SimpleChatModel for details [Bindable] public var
_auth:AdobeHSAuthenticator = new AdobeHSAuthenticator(); [Bindable]
public var simpleChatModel:SimpleChatModel; [Bindable] private var
_cmd:ChatMessageDescriptor; private function init():void {
_auth.userName = "Guest"; _auth.password = null; cSession.login();
_auth.addEventListener(AuthenticationEvent.AUTHENTICATION_FAILURE,
onAuthenticationResponse);
_auth.addEventListener(AuthenticationEvent.AUTHENTICATION_SUCCESS,
onAuthenticationResponse);
cSession.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE,
onSessionEventResponse); cSession.addEventListener(SessionEvent.ERROR,
onSessionEventResponse); } public function
onAuthenticationResponse(event:AuthenticationEvent):void { if
(event.type == AuthenticationEvent.AUTHENTICATION_SUCCESS) {
trace("Authentication Succeeded"); buildModel(); } else if (event.type
== AuthenticationEvent.AUTHENTICATION_FAILURE) {
Alert.show("Authentication Error : " + event.toString()); } } public
function onSessionEventResponse(event:Event):void { if (event.type ==
SessionEvent.SYNCHRONIZATION_CHANGE) { if (cSession.isSynchronized) {
//Now we are connected and the Pods have synchronized themselves, so
switch to main Screen //Switch to Collaborative Pods i.e.
ConnectSessionContainer //vsMain.selectedIndex = 1; } else { //We are
disconnected now cSession.roomURL = null; //vsMain.selectedIndex = 0; }
} else if (event.type == SessionEvent.ERROR) { var sError:SessionEvent =
event as SessionEvent; Alert.show(sError.error.name + " : " +
sError.error.message); } } private function buildModel():void { //
Create the model: just calling the constructor won't create the
collection node or pass the messages. // Call subscribe and five it a
shared ID while creating the model. // The shared ID becomes the name of
the collection node. simpleChatModel = new SimpleChatModel(true);
simpleChatModel.sharedID = "simpleChatModel";
simpleChatModel.subscribe();
simpleChatModel.addEventListener(ChatEvent.HISTORY_CHANGE, onChatMsg); }
private function submitChat(str:String):void { _cmd = new
ChatMessageDescriptor(); _cmd.displayName =
cSession.userManager.getUserDescriptor(cSession.userManager.myUserID).displayName;
trace(_cmd.displayName); trace(str); _cmd.msg = str;
simpleChatModel.sendMessage(_cmd); chat_msg_input.text = ""; } private
function clearChat():void { chat_msg_area.text = "";
simpleChatModel.clear(); } private function
onChatMsg(evt:ChatEvent):void { if (evt.message != null &&
evt.message.msg != null && evt.message.displayName != null) {
chat_msg_area.text += evt.message.displayName + ": " + evt.message.msg +
"\r"; } else { chat_msg_area.text = ""; } }