# [flash]拉覇效果的banner partII

- URL: https://justfly.idv.tw/flash%e6%8b%89%e8%a6%87%e6%95%88%e6%9e%9c%e7%9a%84banner-partii/
- 日期: 2009-05-20
- 分類: WEB&amp;RIA
- 標籤: actionscript, banner, BlurFilter, flash, RIA, setInterval, setTimeout, swf, tween, Tweener

第一版會當掉的問題應該是flash的tween的問題了

今天google了一下換[tweener](http://code.google.com/p/tweener/)來試了一下

目前是沒有發生同樣的情形

不愧是高手高高手開發的東西阿

tweener還提供許多[動態路線](http://hosted.zeh.com.br/mctween/animationtypes.html)可以使用([這邊也有](http://hosted.zeh.com.br/tweener/docs/en-us/misc/transitions.html))

能做的當然也不只位移

模糊 大小 比例 透明 顏色….都可以

不過有的要先初始化才能控制到

像是要控制BLUR的話要先FilterShortcuts.init()

要控制COLOR的話要先ColorShortcuts.init()

不過每初始化一樣都會增加SWF的大小

可以參考[節自官網的下表](http://hosted.zeh.com.br/tweener/docs/en-us/properties/)

  Class path and nameDescriptionApproximate addition to SWF size
caurina.transitions.properties.[ColorShortcuts](ColorShortcuts.html)Includes properties for manipulating the color of display objects, such as   individual channel multiplier and offsets, and special coloring such as hue,   saturation, brightness and contrast.2.2 kb
caurina.transitions.properties.[CurveModifiers](CurveModifiers.html)Modifiers that provide some kind of change for normal tweenings; right now,   the bezier curve only.0.4 kb
caurina.transitions.properties.[DisplayShortcuts](DisplayShortcuts.html)Special properties for display objects such as Sprites,   MovieClips, and TextField instances, include modifiers   for visibility, frame position, and scrollRect size.0.8 kb
caurina.transitions.properties.[FilterShortcuts](FilterShortcuts.html)A list of special properties that simplify the tweening of the built-in   bitmap filters such as Blur, Glow, and many others.3.5 kb
caurina.transitions.properties.[SoundShortcuts](SoundShortcuts.html)Special properties used when controlling sound.0.2 kb
caurina.transitions.properties.[TextShortcuts](TextShortcuts.html)Additional special properties used to change some specific   TextField properties, such as TextFormat properties,   and the text content itself.0.9 kb

還有一個很方便的是它連EventListener也內建了

很容易就可以呼叫下一個動作並帶入參數

加上延遲的時間

很直覺性的可以做出希望完成的動作~

```
import caurina.transitions.Tweener;
import caurina.transitions.properties.FilterShortcuts;
FilterShortcuts.init();
stage.frameRate =30;

var blurMax:Number = 64;
var loopMax:Number = 3;
var stopArr :Array = new Array("",-142,-99,-51,0);
var atArr :Array = new Array("","44444","33333","22222","11111");
var newgoAt:Number;
function init():void {
	for (var i=1; i4? 1:newgoAt;
	for (var i=1; i
```

改用tweener後程式碼感覺也簡單多了～
