Luar's Flash Playground:最近對AS2體會
最近對AS2體會 (03-03-2004)
最近基於MVC模式和AS2寫了很多Code,有兩個Flash應用開發中,對AS2體會:
  • Movie Clip路徑概念被淘汰了,_global、_root、_parent都不應該再用。
  • Variable的Scope要好好留意,編程時一定要保持頭腦清晰。
  • AS2開發時間比以前Movie Clip+AS1的方法花多幾倍時間,未見其利先見其害。
  • 每個項目本地工作目錄使用Namespace,Syntax Check總是會有Error,說找不到Class,但最後Compile就沒有問題,原因是AS不可以設定Classpath,只有Fla才可以設定Classpath,最後只好在Perference設定Global Classpath,加入本地工作目錄。
  • 感受不到Interface的好處,可能只是我一人的小項目,但我自己會保持良好編程習慣。
  • MVC模式分工沒有清晰介定,Controller不一定是Model和View之間中間人,有時View可以直接聯絡Model。究竟是否可以有MV模式Only?
  • 喜歡用Singleton,個人覺得項目沒有多例(Multiple Instances),感覺Object封裝不夠好,好像人人都可以通過Singleton的Method, Getter/Setter改變Static Properties(即Protected Properties),如果有叛徒,是否太危險? :p
  • 比較少用Observer模式,雖然EventDispatcher真是好方便,但如果項目沒有好文檔,沒有UML圖,這麼多Listener和CallBack,事後追蹤很困難。
  • 三個MVC的Classes都是一邊開發、一邊前後修改Code,都怪自己對Object的設計沒有好好規劃好。
  • 要知道自己的MVC的Classes是否設計得好,當Presentation Layer,即View會改變時,只需要改View,不會驚動到Model和Controller。
  • 對Unit Testing感興趣,它可以幫忙Debug,更可以提高Object Design經驗,讓Object更穩健、封閉和重用。
  • 沒有機會或沒有想過用到Exceptional Handling。
  • Strict Data Typing是好,但仍未習慣。 :p
  • 有時重新Export,那些Class Files沒有再Compile,仍然是舊ASO Files,引致問題,當遇到這情形,一定要刪除Documents and Settings下的相關ASO Files,迫Flash Export時,Class Files要再Compile。
  • 有時,系統的時間被改到過去,會引致Class Files和ASO的時間不符,引致編譯錯誤,所以記得將系統的時間設定好,如果Class Files是放在Remote Server,更要將本地時間和Remote Server的時間設定為同步。
  • 我的第2本書是好書……嘿嘿!
本文章由發表。
意見
"; print "沒有意見。
 "; } ?>
  • 小弟有一愚問.
    請問你的知識從何而學.?

    由小西於03-03-2004發表

  • 万分抱歉我用的是简体的Windows本以为用简体选项,没想到出现的还是繁体的乱码。请问 MC路径的概念被什么所替代了?还有对AS2 Class十分有兴趣,能否以这篇文章再深入谈一谈?谢谢!

    由liki於03-03-2004發表

  • 請留意我的第2本書,將來在本站會公佈。嘻。

    luar於04-03-2004發表

  • 想了解Namespace、MVC的一些知識~~

    由Monty於04-03-2004發表

  • 熱烈期盼Luar的第二本書!

    由Monty於04-03-2004發表

  • 請問Luar你的第二本書~~
    台灣買的到嗎??
    期待哩!

    由Neo於04-03-2004發表

  • 已經跟台灣出版社取得聯絡,這本書將會有大陸的簡體中文版和台灣繁體中文版。

    luar於04-03-2004發表

  • 想請問這第二本大作,研討的重點為何?

    由tonys於04-03-2004發表

  • Flash ActionScript 2.0與RIA應用程序開發

    luar於04-03-2004發表

  • 看到了AS2的許多不便我想了解是什麼樣的原因讓你一再深入呢?其實我這懶鬼已經再等下一個版本了...:p

    由Cloud於05-03-2004發表

  • 在台灣好不容易買到你的書,看到第二本有繁體中文版,實在是太期待了,希望不要等太久:)

    由Bagel於05-03-2004發表

  • you metioned
    1.Movie Clip路徑概念被淘汰了,_global、_root、_parent都不應該再用。

    if you are making components, which needs an "_parent" to target certain things, and sometimes, you need that _global to access global variables if you manage a lot of swfs within levels.. no matter you are using actionscript 1 or 2. personal thought I say~ but still, those are still used, also, the _root sometimes can be used when you target level loaded movie, by using the lockroot properity in actionscript 2, contents will be displayed just right.

    and you said..
    Strict Data Typing是好,但仍未習慣。

    well~ if you are going serious into programming, strong typed language is always the choose, and I can see actionscript 2 is trying to get some degree of it , can you say java or C# is wrong, it boost the complier speed, and not to metion all those little things to real OO programs.
    feel free to reply if I am wrong, I am also certified Flash developer , and currently in U.S.

    由amo於16-03-2004發表

  • 1. 這是良好編程習慣問題, _parent我不反對用, _root, _global就要避免, 特別如果你真是用於組件開發上 -_-
    2. 我沒有反對Strict Type, 不要給我莫須有 -_-

    luar於16-03-2004發表

  • _root, _global就要避免, 特別如果你真是用於組件開發上 -_-

    yes, that's right, we should avoid using _root or _global on components development, but i am refering it as " we can still use it " ,cuz sometimes _global does come handy if you are goin to manage a lot of things with in levels and yet the "_parent" should not be avoid of using it, cuz how can you target a clip without using any of these if your movies are 2 or 3 levels' deep?

    It is nice to see other certifid developer, we can discuss the macromedia tech stuff if you are interested and into it
    btw, visit my latest work if you would

    http://www.fingershopin.com

    peace, and comments are appreciated~

    由amo於16-03-2004發表

  • 十分期待你的第二本書 我是台灣人

    由水仔於19-03-2004發表

  • 「Movie Clip路徑概念被淘汰了」我原本以為因為用Dispatcher-Listener的方式,但又看到「少用Observer模式」。如果不用路徑、也不用Event-Listener模式,那要如何處理MovieClip/Object間的互動呢?

    happy於03-07-2004發表

  • 什麼時候在北京也可以買到你的新書?

    ming於28-07-2004發表

同組文章