Let's try to connect to the SmartFoxServer that we've set up and play around some basic connection functions.
1. Create a new Flash document with ActionScript 3.0 supports and save it to the disk.
2. We need to set the class path for the API client of the SmartFoxServer.
3. Click on File | Publish Setting | Flash | Script: ActionScript 3.0 | Settings....
4. Click on the "+" and input the path of the Flash API client. It is located in the SmartFoxServer installation directory | Flash API | ActionScript 3.0.
5. In the same setting dialog, we also assigned the Document Class to
Ch03_01
for our first example in Chapter 3.
Next, let's create the document class file:
1. In Adobe Flash, click on File | New | ActionScript file to create an empty class file.
2. Save the file, and naming it as
Ch03_01.as
, to the same directory of the Flash document that was created in the previously mentioned steps.3. Put the following...