Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8711779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:58:04+00:00 2026-06-13T04:58:04+00:00

Currently i am working on client and Server side communication, using flex and FMS(Flash

  • 0

Currently i am working on client and Server side communication, using flex and FMS(Flash Media Server).
I am trying to execute the below program, which checks the connection status every 2 sec, and disconnects if there is no response from client.

Here i am getting an Error:
ReferenceError: Error #1069: Property pings not found on flash.net.NetConnection and there is no default value.

Client Side Code

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[

    import flash.net.NetConnection;
    public var nc:NetConnection;
    public var res:Responder;
    public function netconn():void
    {
        nc = new NetConnection();
        nc.connect("rtmp://127.0.0.1/ChkConn",user.text);
        nc.addEventListener(NetStatusEvent.NET_STATUS, handle);
    }
    public function handle(event:NetStatusEvent):void
    {
        switch(event.info.code)
        {
            case "NetConnection.Connect.Success":
            status.text="Connected";
            break;
            case "NetConnection.Connect.Failed":
            status.text="Failed";
            break;
            case "NetConnection.Connect.Rejected":
            status.text="Rejected";
            break;
            case "NetConnection.Connect.Disconnect":
            trace("coming");
            status.text="Close";
            break;

        }

    }

    public function pings():void
    {
        trace("a ping call from the server has been received");
    }

    public function disconn():void 
  {
nc.close();
nc.addEventListener(NetStatusEvent.NET_STATUS, handle);
status.text="Disconnected";

}



]]> 
</mx:Script>

<mx:Panel x="224" y="41" width="348" height="118" layout="absolute">
    <mx:TextInput x="84" y="24" id="user"/>
    <mx:Button x="253" y="24" label="Connect" click="netconn()"/>
    <mx:Text x="10" y="26" text="Username"/>
</mx:Panel>
<mx:Text x="235" y="207" text="Status:"/>
<mx:Text x="295" y="207" text="Disconnected" id="status"/>
<mx:Button x="295" y="263" label="Disconnect" click="disconn()"/> 

Server-Side Code

 // ActionScript Communications Document
 application.onAppStart=function()
 {
trace("Application Start");
 };
application.onConnect=function(client,name)
{
anyvariable=name;

monitorConnection(client);
if(name!="user1")
{
    application.rejectConnection(client);
    trace(name+" Rejected");
}
else
{
application.acceptConnection(client);
trace(name+" Connect"); 
}

 };

clientPingResponder = function(client) {

this.onResult = function(res) {
    trace("ClientPingResponder.onResult Received: " + res);
    clearInterval(client.cleanupTaskId);
} 

this.onStatus = function(info) {
    trace("ClientPingResponder.onStatus Received: " + info);
}
};
monitorConnection = function(client) {

client.isAlive = function() {
    trace("client.isAlive has been fired");
    client.cleanupTaskId = setInterval(client.dead, 2 * 1000);
    client.call("pings", new clientPingResponder(client));
}

client.dead = function() {
    trace("cleanupTaskId: " + client.cleanupTaskId);
    trace("monitorTaskId: " + client.monitorTaskId);

    clearInterval(client.cleanupTaskId);
    clearInterval(client.monitorTaskId);

    trace("ghost connection has been detected");

    application.disconnect(client);
}

client.monitorTaskId = setInterval(client.isAlive, 7*1000);
trace("detected");
}


application.onDisconnect=function(client)
{
//application.disconnect(client);
trace(anyvariable +" Disconnect");
};

Any Help is Appriciated. Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:58:05+00:00Added an answer on June 13, 2026 at 4:58 am

    You need something like.

    nc.client = this;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a client/server based Java-program for a customer. I googled a
I'm currently working on a project which needs some server-client communication. We're planning to
Currently, I'm working on a project where I have a server - client relationship
I am working on an IMAP client using java mail. We currently have a
Currently I'm working on a Server-Client system which will be the backbone of my
I'm currently working on a simple client/server file synchronization . For this, client and
I'm currently working on a simple NodeJS client that connects to a PHP server
Currently I'm working on a C/C++ cross-platform client/server software. I'm very experienced developer when
I am currently working on a Flash socket client for a pre-existing service/standard. The
I'm currently working on a website for a client and I'm getting a strange

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.