2

I have a remote flex SharedObject and Im trying (using Red5) to send to all clients a message and an object with some user / sender data.

The problem is: The values displayed in clients are the ones stored on them, not the value in my SO.

Heres some code:

protected function btSend_clickHandler(event:MouseEvent):void
{               
    soChat.setProperty("msg",tiMessage.text);
    soChat.setProperty("userVO",modtrackModel.userVO);
    tiMessage.text = "";        

}

private function syncListener(event:SyncEvent):void
{
    for(var i:Object in event.changeList) {
        var changeObj:Object = event.changeList[i];

        switch(changeObj.name) {
            case "msg":                 
               newMessage(event.target.data["userVO"].userName);                                                                                        
               break;

        }
    }
}


public function newMessage( msg:String):void
{           
    Alert.show(msg);
}

So the problem is, If im Logged as Ricardo in Browser A and Rodrigo in Browser B the Alert shows Ricardo in Browser A and Rodrigo in Browser B... it shouldn't, right? It should show the last value set in my SO, right?

Ty for any help and sry for my bad english.

Ricardo
  • 21
  • 1

1 Answers1

0

You are defining the msg value here:

newMessage(event.target.data["userVO"].userName);  

Which is taking the username info to show in the alert. You should change that to the value you want to show.

VicoMan
  • 289
  • 2
  • 13
  • But im passing the right value there. It even shows the right atribute in the Alert... but it shows client / local values not the one stored in SharedObject... – Ricardo Oct 31 '12 at 12:56