Shared object & Other information

Shared object
Shared object that you are probably English ha ~ SharedObject,
there are two types of flash en sharedObject,
local sharedobject (LSO) and remote sharedobject (RSO),
which is the local share and remote sharing,
remotediscussion, But before you go to learn the best understanding of local, good for you ...
RSO initialization with the server need to establish a connection, continued the previous section,
we first establish a connection with the server

// Initialize to use a remote shared-channel nc
var myNC = new NetConnection();
myNC.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
// Success using this nc initialization rso
initRSO(this);
}
};

Like with the previous code, just connect a number of successful initRSO () function, can not read the back to re-take a look at the first...

function initRSO (NC){
/* On the server to establish myRSO.fso paper, the first two parameters specify nc channel, the first three designated file on the server to retain a lasting, even if the server restart, or have */
my_rso = SharedObject.getRemote("myRSO", NC.uri, true);
my_rso.onSync = function(list) {
// list [{name:"x",code:"success"},{name:"y",code:"success"}]
// list is an object array, similar to this [(name: "x", code: "success"), (name: "y", code: "success")], below shall be saying more about
// Initial success
};
my_rso.connect(NC);
}

Uri check error

mync = new NetConnection ();
mync.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
trace ( "connection successful");
}
};
uri = "rtmp://localhost/connect";
if (mync.connect(uri, "???")) {
trace ( "trying to connect server");
} else {
trace ( "do not try to connect server error ???");
}


application.onConnect = function (client, name) {
trace(name);
if (name == "N God") {
/*
Refuse to connect, and return an error object (msg: "server does not want to" + name + "go, ha ha ~"),
contains an error message
*/
application.rejectConnection (client, (msg: "server does not want to" + name + "go, ha ha ~"});
} else {
//Success can not be returned to the client information
application.acceptConnection(client); application.acceptConnection (client);
}
};

The server returns the information:" + info.application.msg

Nhận xét

Bài đăng phổ biến từ blog này

Ký tự viết tắt trong chat & email

Category 5 / 5E & Cat 6 Cabling Tutorial and FAQ's

Ubuntu LAMP Server