tweener的ColorShortcuts不只可以讓圖片的顏色動起來
也對以下的數值有作用:
- 彩度(saturation)[0~2]
- 色相(hue)[0~180]
- 對比(contrast)[0~3]
- 明度(brightness)[-1~1]
- 濃度(tinBrightness)[-1~1]
但是要動作前一樣要先初始ColorShortcuts
import caurina.transitions.properties.ColorShortcuts;
ColorShortcuts.init()
再來就一樣用Tweener的標準語法就可以歡樂控制了
Tweener.addTween(photo,{_saturation:val});
Tweener.addTween(photo,{_hue:val});
Tweener.addTween(photo,{_contrast:val});
Tweener.addTween(photo,{_brightness:val});
Tweener.addTween(photo,{_tinBrightness:val});
自訂EVENT比較麻煩點點
節錄一點比較相關的CODE:
justfly.GotoItemBtnEvent.as
package justfly{
import flash.events.Event;
public class GotoItemBtnEvent extends Event {
public static const GotoItemBtn_Over:String="gotoItemBtnOver";
public static const GotoItemBtn_Out:String="gotoItemBtnOut";
public var percentage:Number=0;
public function GotoItemBtnEvent(type:String) {
super(type);
}
}
}
GotoItemBtn.as
private function gotoUrlBtnOver(e:MouseEvent):void{
this.dispatchEvent(new GotoItemBtnEvent(GotoItemBtnEvent.GotoItemBtn_Over));
}
private function gotoUrlBtnOut(e:MouseEvent):void{
this.dispatchEvent(new GotoItemBtnEvent(GotoItemBtnEvent.GotoItemBtn_Out));
}
Main.as
gotoItembtn.addEventListener(GotoItemBtnEvent.GotoItemBtn_Over,function(e:GotoItemBtnEvent){autoMoveTimer.stop();});
gotoItembtn.addEventListener(GotoItemBtnEvent.GotoItemBtn_Out,function(e:GotoItemBtnEvent){autoMoveTimer.start();});
這個拿來當商品展示非常不錯耶!
我是想拿來跟flickr結合
呵呵~