2010年7月20日 星期二

FDT 使用ANT建立progression html

ANT的檔案是XML格式,每個檔案都有個project,project裡有多個target就是你一系列想要執行的任務。
而建立html主要是復製一個template.html,並將內容做修改
//Build.XML 


//先把index.template.html檔案復製到專案資料夾裡的bin裡,重新命名為index.html
  

//將index.html檔案裡的${title}替換

 


//index.template.html
//這檔案裡在title裡加入${title}是給ANT替換用

FDT_ANT_progression4Demo.zip

2010年7月18日 星期日

FDT progression4 templates

windows==>preferences==>FDT==>Editor==>Templates
點選import匯入progression4templates.xml

progression4templates.zip

使用時Alt+/再按p鍵可以看到如下圖:




選擇你要的template就會自已貼上

2010年7月11日 星期日

AS3 RSS應用(xmlsyndication.swc)

我們常在全flash網頁上看到的最新消息都只是另開一個新的視窗,連結到blog,而不把內容做在flash裡,要用AS寫出這樣的功能是沒問題的,但單單只是要做到這樣功能,會需要用到資料庫來存取資訊,在維護上如果要做到簡便,會需要多寫個後台來管理,所需的人力時間成本相當的高,如果是採用把最新消息導到blog,直接使用blog的功能,可以達到方便更新又省時省人力,只需多出一個blog版型

Blog都會提供RSS資料,可以透過xmlsyndication.swc方便取得所要資訊。

以下是主要程式碼:

import com.adobe.xml.syndication.rss.Item20;
 import com.adobe.xml.syndication.rss.RSS20;

 import flash.display.MovieClip;
 import flash.events.Event;
 import flash.net.URLLoader;
 import flash.net.URLRequest;

 /**
  * @author georgelynch
  */
 public class RSSDemo extends MovieClip 
 {
  //- PRIVATE & PROTECTED VARIABLES -------------------------------
  private var _RSSFeedURL : String = "http://georgeeeeeeeeee.blogspot.com/feeds/posts/default?alt=rss";
  private var _RSS2 : RSS20;
  private var _ldr : URLLoader;

  //- PUBLIC & INTERNAL VARIABLES --------------------------------
  //- CONSTRUCTOR ------------------------------------------------
  public function RSSDemo()
  {
   _ldr = new URLLoader();
   _ldr.addEventListener(Event.COMPLETE, loadCompleteHandler);
   _ldr.load(new URLRequest(_RSSFeedURL));
  }

  private function loadCompleteHandler(event : Event) : void 
  {
   _RSS2 = new RSS20();
   
   _RSS2.parse(URLLoader(event.target).data);
   var items : Array = _RSS2.items;
   for each(var item:Item20 in items)
   {
    trace('item.title: ' + (item.title));
    trace('item.link: ' + (item.link));
   }
  }
 }

範例下載:RSSDemo.rar

下載SWC:xmlsyndication.swc

2010年7月10日 星期六

Flash CS4新檔預設設定值修改

每次在開新檔案都要設定類別的路徑,可以把Flash CS4新檔預設值修改成自已所要的路徑如下圖。

方法很簡單,只要修改一個XML檔裡的資訊就可以完成修改。



檔案路徑

windwos 7:
C:\Users\Administrator\AppData\Local\Adobe\Flash CS4\zh_TW\Configuration\Publish Profiles

windwos X:
C:\Users\user\AppData\Local\Adobe\Flash CS4\zh_TW\Configuration\Publish Profiles

修改default.xml

../src
.;../src;../classes;../libs