HOMERSS 2.0RSS comments
sizeSMALLMEDIUMLARGEXTRA LARGE
home
time
31 / Thu
07 31 08 18 09
title AS3筆記-FlexSdkCompiler+FDT
title
言
類
論
別

Read This:
http://hubflanger.com/how-to-compile-an-as3-project-with-fdt/

DownLoad This:
http://www.adobe.com/products/flex/flexdownloads/

THEN…

You Can do this:

package
{
import flash.display.Sprite;

public class App extends Sprite
{
[Embed(source="assets.swf", symbol="Star")]
private var Star:Class;

public function App()
{
var star:Sprite = new Star();
addChild(star);
}
}
}

[Embed] Visual Classes in .swf file -> only when you use flex_sdk_compile. (not in Flash IDE)

Problem? mx.* library?
Error: The definition of base class MovieClipAsset was not found.
public class App_a extends mx.core.MovieClipAsset

You will need to add this:
“flex_sdk_3\frameworks\projects\framework\src” for “mx.*” library in flex framework.

more here:
http://www.boostworthy.com/blog/?p=157

embed + class:
http://www.digitalflipbook.com/archives/2007/03/associating_cus.php

Preload:
http://www.bit-101.com/blog/?p=946

example:
embed flex sdk

Cross Editor Setting and Naming: ( flex compiler use the swf generate by Flash IDE)

cross editor

此圖得安排做出兩邊都可以compile的配置: flash compile 出來的 swf 給 flex compiler 當作是 embed library 用.

note: main_ide.swf and main_flex are all runable swfs. (COOL)
In Flash IDE ActionScript 3.0 Settings -> Automatically declare stage instances -> off

php9NyMHq

Flash IDE 會 ignore [embed] code. Flash IDE 裡的 document class, 在 fdt 裡面用 run configuration 設定.

用 Flex sdk compile的好處在哪?

1.可以用 flex 裡面強大的 library, (用Flash IDE也可 加到  preference -> actionscript 3.0 setting -> library path也可)
2.更清楚的規劃 – swf裡面只剩圖形及元件, 所有相對的物件必須要有 class 在外面, 由 [embed] tag 可以知道他連到哪裡? Flash IDE 單純變成繪圖工具.
3.開發時省略切換視窗的麻煩. 在用 fdt 開發的時候也部會一直出現 class 找不到的錯誤.

main_flex.swf 1204 bytes (flex compile 的檔案竟然較大?)

main_ide.swf 791 bytes

main_ide.swf (not runnable library only – take out document setting) 696 bytes


  • 恩... 1 Stars喔~ 2 Stars好! 3 Stars酷!! 4 Stars哇!!! 5 Stars (1 票, 平均: 5.00 / 5) << 請踴躍投票


    Leave a Message

    :) D: :( :D more »