Skip to main content
June 2, 2006
Question

A compenent question

  • June 2, 2006
  • 1 reply
  • 181 views
Hi

I starded with FMS a few days and I tring a exemple to understand some things.

My movie only has a SimpleConnect Compenent and a want that the server-side call a function created by me on the client.

ex:

//SimpleConnect Action Script
this.main_nc.f = function()
{
trace("f");
}

//main.asc
application.onConnect(client, instance, name, password)
{
client.call("f");
}

Is it Possible? Create a function in SimpleConnection´s NetConnector and acess it via Application main.asc file?
    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Inspiring
    June 2, 2006
    Hello

    use NetConnection class :


    [AS]

    var nc:NetConnection = new NetConnection() ;

    nc.onStatus = function ( oInfo ) {

    trace( "> " + oInfo.code) ;

    }


    nc.test = function ( msg ) {
    trace("test : " + msg) ;
    }

    nc.connect("rtmp://127.0.0.1/yourApplication") ; // use your rtmp uri !!
    [/AS]

    et server side :

    [SSAS]
    application.onConnect = function (client) {

    client.call("test", null, "hello world") ;

    }
    [/SSAS]

    NB : important onConnect is a Function !!

    Read FMS documentation !! it's important

    EKA+

    PS : sorry for my english i'm french



    Al Capique a �crit :
    > Hi
    >
    > I starded with FMS a few days and I tring a exemple to understand some things.
    >
    > My movie only has a SimpleConnect Compenent and a want that the server-side
    > call a function created by me on the client.
    >
    > ex:
    >
    > //SimpleConnect Action Script
    > this.main_nc.f = function()
    > {
    > trace("f");
    > }
    >
    > //main.asc
    > application.onConnect(client, instance, name, password)
    > {
    > client.call("f");
    > }
    >
    > Is it Possible? Create a function in SimpleConnection?s NetConnector and acess
    > it via Application main.asc file?
    >