2012年6月28日 星期四

2012年6月27日 星期三

flash simulate low bandwidth

flash 發佈時,需測試低頻寬下 loading 的狀況
之前是用 ccproxy 但常被防毒軟體誤判,
改用 sloppy 簡單用好用。

2012年6月13日 星期三

starling-extension-particle-system

starling with 粒子系統(火焰/燃燒/煙霧/雪花效果)

first edit the particle
幸好有線上版的..XD
http://onebyonedesign.com/flash/particleeditor/
save it

water effect using perlinNoise and DisplacementMapFilter

水波/流體效果

說明如下,
1. 利用 BitmapData perlinNoise 生出雜點紋理圖像
2. 產生可 loop 的參考圖像
3. 捲動參考圖像,參考紅綠兩個 channel

2012年6月6日 星期三

fisheye effect using DisplacementMapFilter

flash 要做出魚眼效果,在 flash8 以前的時代是非常痛苦的事,
不過現在有了 DisplacementMapFilter 這件事比變得簡單多了,
另外還有 Pixel Bender 也可以做到魚眼效果,但這兩個的原理不太一樣,
我自己的測試,Pixel Bender 的效能更好,但要 flash player 10 後
才有支援。

2012年6月4日 星期一

限制 Flash TextField 輸入字數及行數

監聽 TextEvent.TEXT_INPUT 事件,
超過字數及行數使用 e.preventDefault 取消事件。
完整 code 如下:

Remove windows-style line breaks

// 移除換行符號
p_string.replace(/[\r\n]+/g, '');

2D physics:Using Starling with Nape

Using Starling with official pure Nape swcs,

要試玩 starling framework 最簡單的方式就是去安裝
新版的 FlashDevelop(目前是 4.0.2RTM),
會自動把 Flex SDK 4.6 / AIR SDK 3.2 / flash debug player 11.2 通通裝好,

接著安裝 starling
download starling 1.1
http://github.com/PrimaryFeather/Starling-Framework/zipball/v1.1

安裝 Stats 方便觀察 FPS
download Mrdoom's Stats for starling
http://www.kouma.fr/files/stats.zip

安裝 nape
download nape 9.1(as3 debug build swc)
http://deltaluca.me.uk/docnew/