Welcome, Guest
  • Author Topic: application.onConnectAccept send a variable to client  (Read 1794 times)

    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Hi All. By main.asc I want to send a variable to all client. I try this script, but does not works:

    application.onConnectAccept = function(client, name) {
       //---
       myVar = "Hello";
       client.call("myVarResp", null, name, myVar );
                    //--
    };

    client_nc.myVarResp= function(myVar ) {
       _root.f_txt.text = myVar;
       trace(myVar);
    };

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    try

    myVar = "Hello "+name;
    for (i = 0; i < application.clients.length; i++){
      application.clients.call("myVarResp", null, myVar );
    }

    Jorge


    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Thanks, It is works :)