2012年2月15日 星期三

embedding font in as3

已經用好一陣子了,
最近重新使用的時候遇到一些小問題,隨手記下來。

小工具,flash中文字體嵌入助手
http://kevincao.com/2010/07/hanfont/
可以自動產生unicodeRange,相當方便。

2012年2月8日 星期三

gaia preload setting

in preload.fla
設定 scaffold color effect=None
設定 PreloaderScaffold 的 outline layer=Guide
並新開一層 layer 加入新的 loading 特效.

in pages.PreloaderScaffold.as
調整 onResize function
private function onResize(event:Event = null):void
{
  //x = (Gaia.api.getWidth() - width) / 2;
  //y = (Gaia.api.getHeight() - height) / 2;
}
完整 code 如下:

2012年1月12日 星期四

AutoHotKey note

隨手記~~
hotkeys:快捷鍵
^::ctrl
!::alt
#::win

ie:
^!n::ctrl+alt+n
#z::win+z

flashpunk LinearMotion usage

幾個地方要注意
// auto remove when it has finished
var myTween = new LinearMotion(null, Tween.ONESHOT);

// auto stop and run myComplete when is has finished
var myTween = new LinearMotion(myComplete);

myTween.setMotion(to_x, 340, to_x, 300, 0.5, Ease.quadOut);

// don't start immediately
addTween(myTween, false);

you can check myTween.active in update().
完整範例如下:

flashpunk tips

// debug 超好用呀~~
// press ~ : toggle the debug Console on/off.
FP.console.enable();

// global objects
FP.stage
FP.width
FP.height
FP.halfWidth
FP.halfHeight

2011年12月30日 星期五

FlashDevelop compile swfs using a single class file

標題很難下..XD
大家應該有遇過進行小測試時,只想隨便寫個 as
要怎麼測試,又不想特別開一個 Project
更不想開肥大的 Flash CS5 IDE
那怎麼辦呢??

2011年12月16日 星期五

flash countdown timer 倒數計時器

關於 flash 倒數計時器,網路上有很多相關的文章,
但大多是抓取 client 端時間,
本篇加入 server 端時間校正,
防止使用者更改系統時間造成問題。