Skip to main content
February 8, 2012
Question

Why can't my SSAS function be found?

  • February 8, 2012
  • 1 reply
  • 691 views

I am using RTMFP to connect to my Flash Media Enterprise server instance with Influxis.

In my server-side main.asc file, I have something similar to the followowing.:

application.onConnect = function(client) {

    trace("I am connected.");

}

function testit() {

   trace("I am in testit.");

}

My client creates a NetConnection and calls the server site function like this.:

NetConnection netConnection = new NetConnection();

.

.

other details to connect (Connection is established fine...no problem).

.

.

netConnection.call("testit", null);

In my FMS instance logs, I see the "I am connected." message.  But, I don't see the "I am in testit" message.  What can possibly be wrong here?  Why can't the client find the server side function?  Am I missing anything

more in my main.asc file?

Thanks,

Dan

This topic has been closed for replies.

1 reply

February 8, 2012

You need to scope the function to the client object. You can do this by making the function a property of each client individually:

application.onConnect = function(client) {

    trace("I am connected.");

    client.testit = function(){

       trace("I am in testit.");

     }

}

Or, you can add the method to the prototype of the client class, which will make it available to all clients:

Client.prototype.testit = function(){

     trace("I am in testit.");

}

February 9, 2012

Jay:

Yes. This solved the problem....much appreciated!

Dan