2. Chapter 3 AS3 and FlashDevelop Using FlashDevelop 3 for ElectroServer Client Development
3. Client-side Development Environment(附件:Client-side Development Environment.docx)Working with the Flash IDEThe main thing to set up when working with the IDE is the ElectroServerclasspath. Open up Flash and then go to the Edit Menu and select Preferences. Select Actionscript as the Category. Working with the FlashDevelopOpen FlashDevelop then go to the Tools menu and select Global Classpaths. Select AS3 from the drop down list and select Add classpath.
4. ActionScript 3 and FlashDevelopFlashDevelop is a free editing tool.All client code discussed and found in our example files is ActionScript 3, targeting Adobe Flash Player 10. All Projects will be compiled using the Flex compiler. If you install Flash Develop, you’ll be able to easily open and compile all projects.
5. Using FlashDevelop 3Autocomplete is when the code editor anticipates what variable, function, property, or method you are trying to type and gives you a convenient list to choose from.The Flash IDE has a very limited autocomplete built-in that by default will only work with code provided by Adobe during installation. Autocomplete, when done right, is invaluable. It can literally save you hours of time looking things up.
6. Using FlashDevelop 3When using a robust API such as the ActionScript 2 and ActionScript 3 ElectroServer 4 APIs you will quickly go nuts if you have to constantly look up every class name, method name, and property. That is why we suggest using an external code editor such as FlashDevelop 3.
7. Using FlashDevelop 3By installing FD3 and adding the correct API to your classpath, you will be amazed at how much more quickly you can develop and avoid typos.
11. 物件和類別您可以使用 class 關鍵字,自行定義類別。您可以使用三種方式宣告類別屬性:常數可以用const 關鍵字定義變數是用 var關鍵字定義getter 和 setter 屬性則是在方法宣告中使用get 和 set 特質定義。您可以用 function 關鍵字宣告方法。類別實體是使用 new 運算子建立,下列範例會建立 Date 類別的實體,稱為 myBirthday。varmyBirthday:Date = new Date();
26. 函式函式的參數/*定義名為 power 的函式, 它含有一個名為 num 之參數, 且參數之資料類型為數字*/function power(num:Number){trace(num*num); //輸出 num 參數平方值}//呼叫 power 函式, 並傳入 5 做為參數值power(5); //輸出 25
37. SWCFilesA SWC file is an archive file for Flex components and other assets. SWC files contain a SWF file and a catalog.xml file. The SWF file inside the SWC file implements the compiled component or group of components and includes embedded resources as symbols. Flex applications extract the SWF file from a SWC file, and use the SWF file's contents when the application refers to resources in that SWC file. The catalog.xml file lists of the contents of the component package and its individual components.
41. Component LibrariesTo include a SWC file in your application at compile time, it must be located in the library path. For more information about SWC files, see About SWC files.開啟FlashDevelop,把該swc放在專案的資料夾下, 在該swc上按右鍵選擇add to Library
42. Chapter 3 AS3 and FlashDevelop First FlashDevelop Project
43. Create Flash Develop Project(附件:Client-side Development Environment.docx) Creating a Sample ProjectOpen Flash DevelopGo to the Project Menu and select New Project. Select AS3 project.