PDA

View Full Version : NetConnection.call / getLiveStreams / onResult trouble


Dragonspirit
07-04-2005, 09:25 AM
Hello,
I'm trying to code a function that would get all the live streams currently playing on a flash communication server and randomly play one. This function must be invoked on the server-side as the login and password to connect to the server are included in the script.
But I'm experiencing troubles having the netconnection.call method.

Here's the code:
<as>
application.onConnect = function (clientObj) {
function doGetLiveStreams() {
function onGetLiveStreams() {
this.onResult = function (info) {
if (info.code != "NetConnection.Call.Success")
trace ("Call failed: " + info.description);
else
trace ("Stream: " + info["data"][Math.round(Math.random()*(info "data"].length-1))]);
}
}
nc = new NetConnection();
nc.connect ("rtmp://www.hoobys-dev.com:1111/admin", "username", "password");
nc.call("getLiveStreams", new onGetLiveStreams(), "webcam/_definst_");
}
doGetLiveStreams();
}
</as>

I have none of the "trace" output in the logs so I assume the onResult method is never called.
Have any idea why this happens?

(the same code invoked from the client side perfectly works)

I would really appreciate any help, I've been looking for a solution for many hours now