[問題] Tween時靈時不靈?
我想把許多不同的文字一個接一個出現,
所以我用了這種語法:
function moveWords(evt:TweenEvent):void{
evt.target.removeEventListener(TweenEvent.MOTION_FINISH,moveWords);
var theLine = wordText.createTextLine(textLine,300);
if(theLine!=null){
textLine = theLine;
yPos += theLine.textHeight+2;
addChild(theLine);
theLine.x=607;
theLine.y=312;
var xTween:Tween =
new Tween(theLine,"x", Regular.easeInOut ,607,700,30);
var yTween:Tween =
new Tween(theLine,"y", Regular.easeInOut ,312,yPos,30);
var alphaTween:Tween =
new Tween(theLine,"alpha", Regular.easeInOut ,0,1,30);
xTween.addEventListener(TweenEvent.MOTION_FINISH,moveWords);
}else{trace("moveWord over!!")};
trace("moveWord complete");
}
結果大部分時候都是ok的
但是假如匯入的文字太多,就是wordText裡面的內容太長
到了要出現第6~7個TweenEvent.MOTION_FINISH的時候,動畫就會停止。
很明顯能看出來是播到一半就停了,alpha大概在0.3~0.4的樣子
x跟y也就是動到一半的情況。
而且中止那次的moveWord complete有trace出來
為什麼Tween到一半會自己終止?
我怎麼想都想不出原因= =....
請高手指點XD..
**我測試了一下,似乎跟我後面填的數字有關
我填60個影格的話,大概3~4個Tween就會停止
所以我現在只好把影格數改短來暫時解決這個問題...= =
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.252.123
※ 編輯: dsmwang 來自: 140.112.252.123 (09/03 02:27)
推
09/03 02:30, , 1F
09/03 02:30, 1F
→
09/03 02:31, , 2F
09/03 02:31, 2F
→
09/03 02:32, , 3F
09/03 02:32, 3F
推
09/03 02:35, , 4F
09/03 02:35, 4F
→
09/03 09:43, , 5F
09/03 09:43, 5F
→
09/03 10:04, , 6F
09/03 10:04, 6F
→
09/03 10:28, , 7F
09/03 10:28, 7F
推
09/03 12:35, , 8F
09/03 12:35, 8F
→
09/03 12:36, , 9F
09/03 12:36, 9F
推
09/03 13:28, , 10F
09/03 13:28, 10F
→
09/03 15:49, , 11F
09/03 15:49, 11F
推
09/03 17:50, , 12F
09/03 17:50, 12F
推
09/04 16:08, , 13F
09/04 16:08, 13F