In the development of FMS, Flash client and FMS server communication interaction data is common, such as Flash client needs to play a video, need to get FMS sent to the flash end of a message, and so on. So how can we achieve the Flash client and FMS server to establish interactive connection, communication?
This article will take the Flash client to the FMS server communication as the core, in the classic "Hello World" example detailed introduction Flash client to the FMS server communication realization. To achieve both ends of communication, both the client and the server need to encode, while initiating communication requests and receiving communication response information (Flash client), one end provides the receiving request for business processing, etc. (FMS server side).
First from the Flash client, the example of this article is very simple, to achieve the function is the Flash client to the FMS server to initiate a request, invoke a method on the FMS server, and then output the method return value on the FMS server to the console.
Flash end development can be achieved in two ways: Flash and flex. This article will give an example of the implementation of both of these methods. First look at the implementation in Flash.
Start the Flash CS development environment, and create a new Flash file for ActionScript 3.0, as shown below:
Then, on the newly created ActionScript 3.0 Flash file, press F9 into the action panel (where the Code is entered, and of course it can be encapsulated in a separate class file), as shown in the following illustration: