Flash Builder 4工作流程(上)

 

原文地址:http://www.insideria.com/2010/03/intro-to-flash-builder-4-workf.html 

譯者:巴巴魯(請轉載時註明和改編時出處,謝謝)PDF下載

 

 

Flash Builder 4 Flex Builder 3的繼承者。在ADOBE的這次大膽的舉措中,他們最終更名了IDE(Integrated Development Environment集成開發環境),這樣做可以強化Flash封裝Flex AS3開發的概念。這是一個對於那些只使用AS3Flash開發者門的痛處。這將Flash Builder放置在所有使用ActionScript 3 開發集成環境的最佳定位。Flash Builder引入了許多新的特點,我們更好結合Flash IDE,單元測試,明確項目結構,以及一些可喜的速度提升。隨着像Source Mate添加了重構和代碼生成插件,Flash Builder是一個做大型Flex開發的人們的首選。

 

 

這篇文章將介紹Flash Builder 4的工作流程。我不會深入的講解Flex  AS3 的項目流程,但會聚焦於IDE本身,怎樣去配置它,同時着重介紹一些新的特性。這將會是一個在InsideRIA 上聚焦工作流程系列的開始。讓我們開始它。

 

安裝Flash Builder 4

 

Flash Builder 被構建在開源Eclipse 平臺之上。Flash Builder 實際上是一個插件,它自身融入到Eclipse IDE中。正是因爲這樣,有兩種安裝方式供您選擇:標準版以及插件版。

 

 

標準版使用一個自定義的Eclipse 同時被設計爲一個完整的套件。不幸的是標準版剝奪了Eclipse Java工具以及ANT 支持。你可以手動安裝這些插件或者選擇下載Flash Builder插件版本。

 

standalone_install

 

Eclipse Plug-in 安裝程序來源於一個預綁定版本的Eclipse(該版本包含完整的Java工具)或者允許你添加插件到現存版本的Eclipse。首先這可能對一些剛剛開始的人們很難接受,如果你對Eclipse和如何操作插件感覺到不舒服,你可能插入到標準版本。如果你選擇這樣做,我建議安裝插件到最新的Eclipse。版本需要高於3.4

 

plugin_install

 

在文章中我們將要使用標準版。讓我們從這裏下載並且安裝在您的計算機中。在你支付和購買之前,你將會擁有60天的試用期。

 

fb_welcome_screen

瞭解工作空間

 

Flash Builder 正像早前我所提到的,它是基於Eclipse IDE的。Eclipse是一個非常著名的開源 Java IDE,其自身擁有配置和工作流範例。工作空間是一個主目錄,用於Flash Builder 存儲關鍵項目數據例如設置和一些你自定義編輯的內容,以及一些運行所需要的關鍵數據。

每一個工作空間是自己包含開發範圍。這保證你備份工作空間已經移動它到不用的計算機時,原有的設置不被改變。當移動工作空間從一臺計算機到另一臺時,Flash Builder有時將保持絕對路徑,這樣你不得不重新配置你項目中對資源的引用。當使用版本控制時,這需要非常重要考慮的一點,你可能會檢測到一些項目中的具體文件的路徑在你本地計算機或者是資料中,而這些路徑其它開發者並沒有。這將我避免檢查在任何.project內容。

 

 

這是Flash Builder設置的默認工作空間目錄的截圖,

 

default_workspace

 

Mac/Unix上,我避免在目錄名字當中有空格。同時,我通常爲及格不同客戶和私人項目工作,這樣我希望能夠將他們分開。爲了工作的更爲高校,我使用西面的要求來組織我的工作空間:

 

  • 我創建文件夾在我的文檔目錄中,命名爲Workspaces
  • 一旦我使用多個IDEs (FDT, Flash Builder, IntelliJ 甚至 Flash IDE)我爲他們每一個創建文件夾。在這種情況下我有一個Flash Builder 文件夾.
  • 每個我工作的客戶和個人項目將要因爲我的工作空間而改變。因此爲了這篇我創建一個名爲FBWorkflowWorkspace。如果我工作在我的F*CSS 庫我將要創建一個新的工作空間在my Documents/Workspaces/FlashBuilder 文件中.

這時一個我爲這篇文章設置的最終路徑:

custom_workspace_path

Full Path: ~/Documents/Workspaces/FlashBuilder/FBWorkflowWorkspace

通過點擊File -> Switch Workspace,你可以在任意時刻切換工作空間。這是一個重要的提示,你一次只能打開一個工作空間.

定製設置

Eclipse  Flash Builder 有很多的方式設置以充分涵蓋在此介紹但這裏是少數關鍵之一我總是做了修改後的乾淨安裝.

增加更多的內存分配

在你做任何事情之前,你可以添加更多的內存給Flash Builder:

  • 確保你已經退出了Flash Builder.
  • 打開.ini文件。在 Mac上該文件在Flash Builder 4.app -> MacOS -> Adobe Flash Builder 4.ini.PC上該文件在C:/Program Files/Adobe/Adobe Flash Builder 4/FlashBuilder.ini.
  • 找到"-Xmx512m",那是最大內存使用量,並且改變它。我通常使用1024 內存或者更依賴我在工作的項目中的表現.
  • 重啓 Flash Builder.

捷徑

MACFlash Builder 設置可以被找到在Eclipse -> Preferences.

這是參數設置菜單:

preferences

首先,讓我們進入General然後進入Keys菜單.

keys.jpg

我用已經設置一些快捷鍵和默認的一些快捷鍵在Flash Builder上工作。你可以快速跳到快捷方程式通過使用搜索框過濾文本.

Command Description Key
Debug Last Launched I use this to debug my applications. Since I grew accustomed to Flash’s Command + Return to run a Movie, I tend to map this function to that key set up. This allows you to debug the last program you have launched (I will explain Runs and Compiling a little later). This function I map to Command + Return since it is not set up to that by default. Command Return
Run Last Launched *Optional* If you don’t want to use the Debug Player when you compile your Flash app, you can use this as your default build launcher. It will launch your project in a default browser without any debug code and will ignore any breakpoints. You should not map “Debug Last Launched” and “Run Last Launched” to the same key. When using both, I tend to map Run Last Launched to Shift + Command + Return Shift + Command + Return*
Delete Line To Delete an entire line of code simply press Command + D. Command + D
Find and Replace This is a standard Find and Replace in a document. Command + F
Find in File This is a powerful Find and Replace type function that lets you search across multiple files. Shift + Command + F
Line End Jumps to the end of the line. Command + Right Arrow
Line Start Jumps to the beginning of a line. Command + D
Move Lines Up Take a selection of lines and move them up. This is useful when organizing code or changing the order of actions in a given method. Command + Up Arrow
Move Lines Down Take a selection of lines and move them down. Command + Down Arrow
Next Perspective Perspectives represent different types of Editors or areas of functionality in Flex Builder. Imagine going from the ActionScript editor to the debugger to the SVN repository explorer. Each of these is a different type of perspective and have their own collection of relevant windows. I tend to think of this a an application switcher inside of Eclipse. I use this a lot and felt it was better to change the default keys to something easier to call. Shift + Command + Right Arrow.
Previous Perspective See Next Perspective description above. I change the default keys to the following. Shift + Command + Left Arrow.
Organize Imports I had mentioned before that Flex Builder will help you keep track of Imports. Well this is the short cut to do it. Flex Builder will automatically remove any packages that are not needed and reorder used imports based on their priority and source package. Shift + Command + O
Save All When you have multiple documents open and you need to save them all to do a build, use this. Shift + Command + O
To Lower Case Use this to convert a selection to lower-case text. Shift + Command + Y
To Upper Case Use this to convert a selection to upper-case text. Shift + Command + X
Word Completion Probably the most powerful command in Flex Builder. This calls an auto complete menu based on what you have typed in. If you were to type out “Spr” and call the word completion it would pop up a menu with Sprite (and a few other close matches) for you to choose from. Once you make a selection, Flex Builder will also attempt to import the class for you. Your custom classes will also show up in this menu along with the built in classes the Flash Player supports. I can’t live without this! Control + .

配置WEB瀏覽器

現在讓我們察看WEB瀏覽器菜單。如果你想要在你機器上的不同瀏覽器中測試,這是非常有用的。現在我使用Chrome beta作爲我的默認,但我做所有的調試在FireFox我也覺得是有幫助的使用不同的瀏覽器,調試器測試時,有時會因爲瀏覽器崩潰或使掛起.

browsers.jpg

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章