[flash]用tweener做動態文字的濾鏡(filter)

LINEで送る
[`evernote` not found]


完成的效果就如上
只要記得把caurina.transitions.properties.FilterShortcuts引用進來初始化
其他應該就沒有啥問題了
範例中的舞台上只有放一個叫做『gotoUrlBtn』的MovieClip
裡面包著一個『url_txt』的動態文字跟寫上『gotoUrlBtn』的靜態文字
附上在影格中的程式碼:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import flash.events.*;
import flash.filters.GlowFilter;
 
import caurina.transitions.*;
import caurina.transitions.properties.FilterShortcuts;
FilterShortcuts.init();
 
var changeTxtTimer:Timer=new Timer(300);
var transition:String="easeOutExpo";
 
//GlowFilter(color:uint = 0xFF0000, alpha:Number = 1.0, blurX:Number = 6.0, blurY:Number = 6.0, strength:Number = 2, quality:int = 1, inner:Boolean = false, knockout:Boolean = false)
var glowIn:GlowFilter=new GlowFilter(0xffffff,0.9,2,2,10,5);
var glowOut:GlowFilter=new GlowFilter(0xffffff,0,2,2,10,5);
 
 
//gotoUrlBtn.url_txt.cacheAsBitmap = true;
gotoUrlBtn.buttonMode=true;
gotoUrlBtn.addEventListener(MouseEvent.CLICK,gotoUrlBtnDown);
gotoUrlBtn.addEventListener(MouseEvent.ROLL_OVER,gotoUrlBtnOver);
gotoUrlBtn.addEventListener(MouseEvent.ROLL_OUT,gotoUrlBtnOut);
 
 
function gotoUrlBtnOver(e:MouseEvent):void {
	Tweener.addTween(gotoUrlBtn.url_txt, {_filter:glowIn, time:0.3, transition:transition});
}
function gotoUrlBtnDown(e:MouseEvent):void {
}
function gotoUrlBtnOut(e:MouseEvent):void {
	Tweener.addTween(gotoUrlBtn.url_txt, {_filter:glowOut, time:0.3, transition:transition});
}

6 則迴響於《[flash]用tweener做動態文字的濾鏡(filter)

回應已關閉。