首先要知道有哪些 gaia flow events 可用
beforeGoto
afterGoto
beforeTransitionOut
afterTransitionOut
beforePreload
afterPreload
beforeTransitionIn
afterTransitionIn
afterComplete(no hijacking)
假設要在 transitionIn 之前做一些事,
先宣告
private var releaseGaia:Function;
// in constructor
releaseGaia = Gaia.api.beforeTransitionIn(onBeforeTransitionIn,true);
private function onBeforeTransitionIn(event:GaiaEvent):void {
// do something...
releaseGaia();
}
另外在 Navigation 裡常用的手法,
// in init
Gaia.api.afterGoto(setPageId, false, false);
private function setPageId(e:GaiaEvent):void {
trace(e.validBranch);
}
用來做 breadcrumb 還蠻方便的。
http://www.gaiaflashframework.com/wiki/index.php?title=Events_and_Hijacking
沒有留言:
張貼留言