Flash communication server
Just started a little project that involves online gaming. One of the most important aspect of online gaming of course is message broadcast among clients. Quite frankly, flash itself have no facilities for doing that. It can do sendandload, xml stuff, but when it comes to server side, flash have absolutely nothing. That's when FCS comes in. You can get flash to connect to it whenever the apps start. It's done using shared object. Whenever the value of a "data" in the SO changes, its value will be broadcasted to all that is connected. Quite nifty. And don't need much codes !!
_root.client_nc.connect("rtmp:/myapps/");
users_so = SharedObject.getRemote("users_so", _root.client_nc.uri, false);
users_so.connect(_root.client_nc);
users_so.onSync = function(userList) {
response.text = _root.users_so.data.x;
}
That's all!!!
If you make users_so global, you can change it anywhere in the apps, and all apps that is connected to FCS will be notified by the onSync function. IAW, users_so is like a local copy of the remote SO.
Kenneth
0 Comments:
Post a Comment
<< Home