利用Tweener製作動畫 – 廣告看板
依然是Tweener範例清倉,本篇範例大致是搭配Tweener讓目標物移動到指定座標的效果,話不多說看範例吧!
Tweener 橫幅廣告 範例:主要為利用Tweener針對廣告看板進行移動,以下為本範例的程式碼:
import caurina.transitions.Tweener; var i:int;//迴圈用變數 var pic:int = 1;//播放張數紀錄變數 var clock;//計時器變數 //按鈕變色與監聽 btnChange(); function btnChange() { for (i=1; i<=4; i++) { this["b" + i].gotoAndStop(1); this["b" + pic].gotoAndStop(2); } } for (i=1; i<=4; i++) { this["b" + i].addEventListener(MouseEvent.CLICK,clickFn); } function clickFn(e:MouseEvent) { clearInterval(clock); clock = setInterval(autoChange,5000); pic = e.currentTarget.name.substr(1,1); bannerChange(); btnChange(); } //計時器設定(每5秒更換) clock = setInterval(autoChange,5000); function autoChange() { pic++; if (pic>4) { pic = 1; } bannerChange(); btnChange(); } //圖片切換函數 function bannerChange() { Tweener.addTween(banner, {x:(pic-1)*-560, time:1, transition:"easeOutQuint"}); }
Tweener 移動看板 範例:與上面範例大致相同,不過本範例增加了縱向的移動。
import caurina.transitions.Tweener var i var j var targetX var targetY for(i=1;i<=3;i++){ for(j=1;j<=3;j++){ this["b"+i+j].addEventListener(MouseEvent.CLICK,moveFn) } } function moveFn(e:MouseEvent){ targetX=(e.currentTarget.name.substr(2,1)-1)*-450 targetY=(e.currentTarget.name.substr(1,1)-1)*-450 Tweener.addTween(nb, {x:targetX, y:targetY, time:2, transition:"easeOutQuint"}); }
s2wuky
order generic lasix order furosemide 40mg generic where to buy furosemide without a prescription
purchase serophene online clomiphene 50mg for sale clomiphene 50mg for sale
Thanks for the complete information. You helped me.
purchase gabapentin pills cost neurontin 600mg neurontin 100mg generic
purchase levothyroxine for sale cost synthroid buy levothyroxine without prescription
buy omnacortil medication buy cheap generic prednisolone prednisolone 10mg generic
amoxiclav cheap cheap augmentin 1000mg order augmentin
Thanks for the complete information. You helped me.
purchase azithromycin generic order generic zithromax purchase azithromycin generic
order ventolin inhalator without prescription order ventolin 4mg generic order albuterol 2mg sale
order generic amoxicillin 500mg amoxicillin online buy amoxicillin brand
order rybelsus online rybelsus 14mg cheap buy rybelsus cheap
isotretinoin 40mg drug purchase accutane for sale purchase isotretinoin online cheap
buy semaglutide 14mg without prescription rybelsus 14mg cheap how to get rybelsus without a prescription
buy deltasone 10mg generic order generic deltasone 20mg deltasone 5mg drug
buy clomid 100mg generic order clomiphene 100mg online cheap generic clomiphene 100mg
cheap tizanidine 2mg brand tizanidine tizanidine 2mg over the counter
buy generic vardenafil for sale buy generic vardenafil
synthroid for sale online cheap levoxyl online order synthroid 100mcg online
augmentin online buy augmentin cost
purchase albuterol online order albuterol pill generic allergy pills
order generic doxycycline monodox pills
amoxicillin 250mg generic buy amoxicillin 1000mg pills order amoxil 500mg sale
buy omnacortil paypal omnacortil 20mg us omnacortil 10mg cheap
furosemide 40mg price cheap lasix 40mg
azipro 250mg sale buy azithromycin 500mg generic azithromycin 500mg generic
gabapentin 600mg for sale order neurontin 600mg
zithromax 250mg drug order azithromycin 250mg generic zithromax drug
strongest sleeping pills at walgreens buy melatonin 3mg sale