Skip to main content
January 19, 2011
Question

Server Side ActionScript - application.onConnect

  • January 19, 2011
  • 1 reply
  • 784 views

Hi Guys...

I understand fom the Server Side ActionScript API that the 'application.onConnect' method's parameter settings include a client obect and some optional parameters. It seems to me that for the optional parameters, it has to be a string value. If I were to make a call from from my .as file as follows:

nc.connect(rtmpNow,"anchor");

and the application.onConnect method is as follows in the .as file:


application.onConnect = function(client,nameNow)
{
client.name=nameNow;
//Followed by other lines of code........

}


the above works fine as in I can do a trace to print the value of nameNow. However If I had send it a string variable (initialized), instead of a string value itself, than all I would get is a null in the trace. The API however dosen't seem to explicitly mention that the optional parameters must be string. I hope someone can advise me if it is at all possible to send as arugment to applicaton.onConnect, non string values,variables. Thanks.

(PS:- The server side action script API ( http://www.adobe.com/livedocs/flashmediaserver/3.0/hpdocs/help.html?content=Book_Part_34_ss_asd_1.html )

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    January 19, 2011

    I have tried such thing in past and i know it works. There is nothing like its takes only strings or parameters are passed as "string".

    I just again tried passing variable which is assigned string value and could successfully trace it on Server-side application.onConnect

    Basically you can pass any type of value in nc.connect() - say if you are passing numbers, you can just do conversion of it to number using Number() on SSAS.

    Can you trace your variable value just before you call nc.connect on client side and see whether assignment on client side has happened fine. Also which version of FMS are you using and is it possible for you pass me your client and server-side code snippets.