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 1033177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:11:33+00:00 2026-05-16T14:11:33+00:00

Here’s my problem: I have a NetConnection object connected to a server. On top

  • 0

Here’s my problem: I have a NetConnection object connected to a server. On top I create a NetStream object and it started to play a file from the server. Classic so far.

What I need now, is to be able to send some (short) messages back to the server, at various moments during playtime but, clearly, using the existing TCP connection.

From what I can read in the docs, the underlying NetConnection object supports “two-way connection between a client and a server” and obviously the TCP layer supports it. I am aware of TCP networking concepts fairly well, but definitely not of how Flash implements them.

  1. Is this correct? Can it be done using NetConnection (or some other mechanism)?

  2. How would I go about doing this (an example would be great, but a conceptual description of the process would work just as well). How exactly do I send a message from the client to the server via NetConnection?

  3. Does the active NetStream object interfere in any way with such an operation?

Thanks.

  • 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-05-16T14:11:34+00:00Added an answer on May 16, 2026 at 2:11 pm

    Yes, you can.

    I assume, we are talking about connection to Flash media Server.

    Use NetConnection.call() method which remotely executes server-side script method.

    public function call(command:String, responder:Responder, ... arguments):void
    

    You have to define this server-side method as a prototype of connection client class

    e.g.

    Client.prototype.MyMethod = function(arg)
    {
    trace("Server received " + arg + "\n");
    }
    

    Then calling this method should look like:

    var nc:NetConnection;
    
    //initialize net connection and connect
    
    nc.call("MyMethod", null, "Hello, server");
    

    If you need to get some result – use Responder class instance instead of null.

    If you need server to call client’s method use server-side “call” function on client object.
    In this case you’ll have to define some object at client side, wich has the callback method:

    Client side:

    var obj = new Object();
    obj.MyCallback = function(arg:Object)
    {
    trace ("Received message from server: " + arg as String);
    }
    nc.client = obj;
    

    Server side:

    clientObject.call("MyCallback", null, "Hello, client");
    

    Regards,
    David.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.