|
Using FlashDevelop |
|
|
http://www.youtube.com/watch?v=V_g4RqO0ML8 This video is part 1 of 2 that show the basics of Flash with ElectroServer. But it starts off by showing how to set up a Flash Develop project that works with ElectroServer. |
Before you read
Overview
While any IDE can be used to author ElectroServer applications, most of the ActionScript examples provided on this site or with the ElectroServer installation were authored using FlashDevelop. Below you will learn how to open a project, create a new project, and add the ElectroServer SWC to the classpath.
Opening an existing project
To open an existing project simply double-click on the project file. The project file name contains the name of the project with a *.as3proj extension. For example: Connect and Login.as3proj
Once opened you can author code and modify compile settings (such as frame rate and application dimensions). Any project can be compiled simply by pressing control + enter or F5.
Most projects contain at least three directories:
Creating a new project
When authoring ElectroServer applications using ActionScript 3 you will likely create one of three types of projects:
To create a new project in FlashDevelop:
This will create a project file, bin folder (for the compiled application), a lib folder (for SWCs), and a src folder (for the code). If it is an AS3 Project then a Main.as file is created in the src directory. If it is a Flex project then a Main.mxml file is created in the src directory.
Adding ElectroServer.SWC to the classpath
To gain access to the ElectroServer API, add ElectroServer.swc to the project's classpath. The SWC can be found in the [installation folder]apis/client/as3/dist.
The easiest way to add to the classpath in FlashDevelop is to copy the SWC file directly into the lib folder found in the project directory that you created. Then, in the project view right-click on the SWC and chose 'Add to Library'.

Now that the SWC is in the project's classpath, you will get code help when using the API.

Viewing trace output
Depending on what you already had installed before installing this IDE, FlashDevelop might use the non-debug version of the standalone player when testing your application. The application will work just fine, but FlashDevelop will not capture the trace output and runtime errors will not be shown. You can tell if you are running the debug player by compiling to test an application, and then right-clicking on it. It should look like this.

If you do not see the word 'debug' anywhere in your context menu like in the image above, then you'll need to download the appropriate player and associate it with FlashDevelop. To do that,
Put the file wherever you want and then tell FlashDevelop where to find it. To do that,
