How does Flash interact with services / scripts on servers through AMF?
Data is transmitted over a TCP / IP connection. Sometimes an existing HTTP connection is used, and in other cases, a new TCP / IP connection is opened for AMF data. When HTTP or additional TCP connections are open, the socket interface is probably used. AMF definitely travels over a TCP connection, and a socket interface is practically the only way to open such a connection.
The transmitted data consists of ECMA-script (Javascript (tm)) data types, such as "integer", "string", "object", etc.
For a technical specification of how objects are encoded into binary files, Adobe published the specification: AMF 3.0 Spec on Adobe.com
As a rule, the client / server AMF use system works, something like this:
- The client displays some user interface and opens a TCP connection to the server.
- The server sends some data to the client, which updates its user interface.
- If the user makes a command, the client sends data to the server over a TCP connection.
- Continue steps 2-3 until the user logs out.
For example, if the user clicks the send mail button in the user interface, then the client code can do this:
public class UICommandMessage extends my.CmdMsg
{
public function UICommandMessage (action: String, arg: String)
{
this.cmd = action;
this.data = String;
}
} Then later:
UICommandMessage msg = new UICommandMessage ("Button_Press", "Send_Mail");
server_connection.sendMessage (msg);
in the server code, the server also monitors the connection for the incoming AMF. It receives a message and transfers control to the corresponding response function. This is called sending a message.
With more information about what you are trying to accomplish, I could give you more useful details.