2005/8/22

My First Flash Lite Game-打地鼠


上週買了部二手的Nokia6680,回家第一件事當然是上線購買FlashLitePlayer1.1
弄了個打地鼠雛型算是對Flash Lite做個初步練習吧。
另外又寫了個3D球旋轉的…原來 FL1.1 支援Math.cos 、Math.sin,但跑起來簡直是龜速(以6680來說,1顆球10.6FPS,9顆球2.3FPS ,慘~)
有興趣的人抓回去試試囉。[兩範例下載 ]
最後分享一點心得:

2005/8/11

Miniclip的遊戲比賽

gotoAndPlay()看到的消息,知名的FlashGame網站Miniclip要辦比賽囉,有興趣的人可來試試身手,摘要如下,詳情點這裏
.獎金$3000(與Miniclip簽約2個月)
.截稿日2005/11/18
.可使用Flash(5,6,7版)、Director(8.5)、Java
.含外部檔,總數不得超過3MB
.尺寸小於800*600

2005/8/9

Studio8相關連結整理

Studio8
昨天最大的新聞莫過於Studio8問世,Macromedia刻意選在8月8日8:00 am宣佈這個消息。
就我個人的感覺,Flash8是一個全新的開始,這些革命性的新功能,將徹底改變我們以往熟悉的製作流程及表現手法,甚至影響我們發想作品時的思考方向。拭目以待囉~
將一些相關連結整理起來:

官方新聞稿
Studio 8: Meet Your Match很不錯的Studio8體驗頁
產品介紹
Flash8新特性說明
訂閱試用版公佈訊息
一系列seminar
Customer Success Story: DCI(台灣)
.Flashmagazine公佈了一些Flash8 IDE的screenshot
Danger's Blog這篇,為近期出現的一些Flash8範例做了個方便觀賞的瀏灠器,coool~
Flashguru上的一些範例
Studio8產品發表會(台灣)

2005/8/8

Flash歷史資料蒐集

你知道Flash各版本發表的日期嗎?你也許知道SmartSketch及FutureSplash,但你也知道SuperPaint、CelAnimator是什麼嗎?你知道Flash與LEGO積木的關係嗎?你知道.spa、ssk是什麼檔案格式嗎?
一時興起蒐集了些Flash發展歷史的相關連結,有興趣的人可參考看看。
(PS.這些資料很適合在Flasher聚會閒聊or授課教學第一章使用)

Flash歷史 [by Luar](年表、Flash5~MX2004發表時網頁擷圖)
The Flash History[via: FlashMagazine.com](你聽過SuperPaint、CelAnimator嗎?)
The History of Flash[by Jonathan Gay](聽聽作者的現身說法,就知道Flash與LEGO積木的關係)
The Flash History Legend(雖然只寫了FutureSplash的部份,但相當完整,多圖)
早期FutureWave.com上介紹FutureSplash的網頁圖(從IE的工具列看得出來這張圖年代久遠,而今日的www.futurewave.com則會直接連到Macromedia裏Flash的產品介紹頁)
FutureSplash的包裝封面(日文網頁)
Wikipedia對Flash有詳細的記載(你知道.spa .ssk各是什麼檔案嗎?)
Wikipedia對ActionScript的記載
wikipadia中文版的Flash解譯
不同时期的 Macromedia 首页[by Danger]
Flash10週年紀念site,裏面有許多相關資料及圖片,也有歷年代表性網站的記錄,當然,這個紀念site本身也很Flash。

來個年表吧(下表取自wikipedia)
* FutureSplash Animator (1995) - initial version of Flash with basic editing tools and a timeline
* Flash 1 (December 1996) - a Macromedia re-branded version of the FutureSplash Animator
* Flash 2 (June 1997) - the object library was added to Flash
* Flash 3 (31 May 1998) - the movieclip element, Javascript plug-in integration, transparency and an external stand alone player was added to Flash
* Flash 4 (15 June 1999) - internal variables, an input field, advanced Actionscript, and streaming MP3
* Flash 5 (24 August 2000) - Javascript like Actionscript, Smartclips, HTML text formatting added
* Flash MX (15 March 2002) - UI Components, XML, compression, streaming video codec
* Flash MX 2004 (10 September 2003) - text alias, Unicode, Actionscript 2.0, improved streaming video codec, behaviours
* Flash MX 2004 Pro (10 September 2003) - all Flash MX 2004 features plus a form and slide editor, web services integration, Object Oriented Programming in ActionScript 2.0, and Media Playback components, which encapsulate a complete MP3 and/or FLV player in a component that may be placed in a SWF.
* Flash Basic 8 (released on September 13, 2005) - A less feature-rich version of the Flash authoring tool targeted at new users who only want to do basic drawing, animation and interactivity. Released with Flash Player 8, this version of the product has very limited support for video and advanced graphical and animation effects.
* Flash Professional 8 (released on September 13, 2005) - Released with the Flash Player 8, Flash Professional 8 added features focused on expressiveness, quality, video, and mobile authoring. New features included Filters and blend modes, easing control for animation, enhanced stroke properties (caps and joins), object-based drawing mode, run-time bitmap caching, FlashType advanced anti-aliasing for text, On2 VP6 advanced video codec, support for alpha transparency in video, a stand-alone encoder and advanced video importer, cue point support in FLV files, an advanced video playback component, and an interactive mobile device emulator.


歷代FlashPlayer對AS的支援(取自wikipedia)

* Flash Player 2: First version with scripting support, actions included gotoAndPlay, gotoAndStop, nextFrame and nextScene for timeline control.

* Flash Player 3: Expanded basic scripting support with the ability to load external SWFs (loadMovie).

* Flash Player 4: First player with a full scripting implementation (called Actions). The scripting was a slash based syntax and contained support for loops, conditionals, variables and other basic language constructs.

* Flash Player 5: Included the first version of true ActionScript. Used Prototype-based programming based on ECMAScript, and allowed full Procedural programming and Object-Oriented programming.

* Flash Player 6: Added an event handling model, and support for switch.

* Flash Player 7: Flash Player 7 offered some new features such as CSS text and performance improvements. Macromedia Flash compilers released alongside Flash Player 7 also support ActionScript 2.0, a Class programming language based on the ECMAScript 4 Netscape Proposal. However, ActionScript 2.0 can cross compile to ActionScript 1.0 byte-code, so it can be run by Flash Player 6.

* Flash Player 8: Further extended ActionScript 2.0 by adding new class libraries with APIs for controlling bitmap data at run-time, and file-upload.

* Flash Player 9 (initially called 8.5): Added ActionScript 3.0 with the advent of a new virtual machine, called AVM2 (ActionScript Virtual Machine 2), which coexists with the previous AVM1 needed to support legacy content. Performance increases were a major objective for this release of the player including a new JIT compilation. This is the first release of the player to be titled Adobe Flash Player.

* Flash Lite 1.0 and 1.1: Flash Lite is the Flash technology specifically developed for mobile phones and consumer electronics devices. Flash Lite 1.1 supports Flash 4 ActionScript.

* Flash Lite 2.2: Added support for Flash 7 ActionScript 2.01.


2005/8/4

swapDepths使用心得之別走回頭路!

奇怪的標題。今天發現當我們對timeLine上原有的物件進行swapDepth後,若timeLine的播放頭向前移動後,最好別再讓播放頭往回走,否則會出現物件重覆的狀況。
以前我是知道這個問題的,但我一直以為只要不回到小黑點KeyFrame那一格就沒事,沒想到一般frame也會造成衝突。
(為了這小問題竟卡了我2天左右~ )

光看上述文字說明可能還是不知所云,請看看下面範例:

原始檔按此下載


這是一個20個frame的Flash文件,裏面較大那個方塊命名為"box",是手動拉到timeLine上的movieClip,keyframe位置在第一格frame,但存在長度有到frame20。同時在frame1時,我就用swapDepths(5),把box移到depth5的位置,然後用stop()停在frame1的位置。
另外下面有5、10、15、20四個btn,按下去則可gotoAndStop()至不同的frame。問題來了,如果依序5、10、15、20去按是不會出錯的,但一旦往回按,例如先按10再按5、或先按20再按15,box的depth就會出錯,就不會是5而變成-16382了。
(*麻煩的是這個範例我沒做Reset,錯了就要Reload)

原本我以為是depth出錯,後來發現不是,我是以box.getDepth()來取得深度,當5變成-16382時,並不是真的把box從5變成-16382,而是在-16382生出一個新的"box"。也就是depth5跟-16382各有一個名叫"box"的MC,而且當用_root.box、box .xxx之類的,都會指到新的box。

透過這個特性,我想到了一個timeLine+swapDepths的Mc複製法,完全不用attachMovie或duplicateMovieClip哦…(呼呼…但尚不知這有何實質用途 ,哈!)


按右上角的方塊會for(var i in _root){trace(i)} ,很有趣會發現大家都叫"ball"沒錯。

當我終於瞭解它不是把depth弄亂,而是因為timeLine的關係造成複制後,解決方法就是將需要swapDepth的物件,縮短它存在於timeLine上的長度,最好是一swapDepth後,就不存在於timeLine上了。當然另一個方法就是播放頭別走回頭路。




(*我還是很納悶,為什麼往前播就ok,往後就會出錯?)