Question
Newbie Stupid Problem
Hi All,
I'm an expirienced developer in Flash, but recently I was forced to deal
with Flash Media Server.
I'm quite excited but I have one really stupid question:
I want to have an application which will call client's function and pass a
parameter to it.
Any replies are warmly welcome!
Here is what I have :
// APPLICATION
application.onAppStart = function() {
trace("onAppStart> " + application.name + " is starting at " + new
Date());
}
application.onConnect =function(clientObj,userName, password){
trace("we are connected");
application.acceptConnection(clientObj);
//setting parametter to the client
clientObj.RedirectURL="rtmp:/appName/tesgin_new_instance";
clientObj.call("testFunction");
};
// END OF APPLICATION
// CLIENT ACTIONSCRIPT
// First, make sure an onStatus
NetConnection.prototype.onStatus = function(info){
trace("NetConnection STATUS: " + info.code);
}
nc =new NetConnection();
nc.testFunction = function(){
trace("testFunction -> nc.RedirectURL: "+this.RedirectURL);
}
if ( nc.connect("rtmp:/appName/") ){
trace("Attempting connection...");
} else {
trace("Can't attempt connection. Is the URI correct?");
}
// END OF CLIENT ACTIONSCRIPT
PROBLEM DESCRIPTION:
Cannot find the nc.RedirectURL parametter from the nc object.
Its undefined.
I've tried it with a parametter on the testFunction and display it.. along
with clientObj.call("testFunction","redirTest");
And its still not returing this string.
Please whats the problem with this code ???
I'm an expirienced developer in Flash, but recently I was forced to deal
with Flash Media Server.
I'm quite excited but I have one really stupid question:
I want to have an application which will call client's function and pass a
parameter to it.
Any replies are warmly welcome!
Here is what I have :
// APPLICATION
application.onAppStart = function() {
trace("onAppStart> " + application.name + " is starting at " + new
Date());
}
application.onConnect =function(clientObj,userName, password){
trace("we are connected");
application.acceptConnection(clientObj);
//setting parametter to the client
clientObj.RedirectURL="rtmp:/appName/tesgin_new_instance";
clientObj.call("testFunction");
};
// END OF APPLICATION
// CLIENT ACTIONSCRIPT
// First, make sure an onStatus
NetConnection.prototype.onStatus = function(info){
trace("NetConnection STATUS: " + info.code);
}
nc =new NetConnection();
nc.testFunction = function(){
trace("testFunction -> nc.RedirectURL: "+this.RedirectURL);
}
if ( nc.connect("rtmp:/appName/") ){
trace("Attempting connection...");
} else {
trace("Can't attempt connection. Is the URI correct?");
}
// END OF CLIENT ACTIONSCRIPT
PROBLEM DESCRIPTION:
Cannot find the nc.RedirectURL parametter from the nc object.
Its undefined.
I've tried it with a parametter on the testFunction and display it.. along
with clientObj.call("testFunction","redirTest");
And its still not returing this string.
Please whats the problem with this code ???
