利用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"}); }
cost cheap lyrica without insurance can i purchase lyrica price buying cheap lyrica tablets
top ten essay writing services
help with essays
cheap custom essays
Its wonderful as your other blog posts : D, regards for putting up.
cost of cheap lyrica without rx can i buy cheap lyrica without prescription can i purchase generic lyrica without rx
college essay editing service
write my essay fast
review of essay writing services
I am lucky that I discovered this website , precisely the right info that I was searching for! .
where to get lyrica tablets where can i get cheap lyrica no prescription where to get lyrica pills
You are my inspiration , I possess few web logs and very sporadically run out from to brand 🙁
custom application essay
writing an essay help
customer essay
pregabalin 150 mg cost lyrica 150 mg pills pregabalin 150 mg uk
order pregabalin 75 mg online cheap pregabalin order lyrica uk
mba application essay writing service
college essay help long island
application essay help
Hello ! I am the one who writes posts on these topics casinosite I would like to write an article based on your article. When can I ask for a review?
Hello there, You have done an incredible job. I will certainly digg it and personally recommend to my friends. I am sure they will be benefited from this site.
cheap neurontin 400 mg buy gabapentin 100 mg neurontin 100 mg uk
There most be a solution for this problem, some people think there will be now solutions, but i think there wil be one.
order neurontin 100 mg for sale purchase gabapentin generic brand neurontin 100 mg
I love what you’ve created here, this is definitely one of my favorite sites to visit.
I am glad to be one of the visitors on this great site (:, appreciate it for putting up.
Good site! I truly love how it is easy on my eyes it is. I am wondering how I might be notified when a new post has been made. I’ve subscribed to your RSS which may do the trick? Have a great day!
urgent custom essays
help with essay writing
essay writers
I thought it was going to be some boring old post, but I’m glad I visited. I will post a link to this site on my blog. I am sure my visitors will find that very useful.
buy diovan 80 mg buy valsartan 80 mg pill valsartan canada
best essay help
write my college essay
help me essays
I really believe you will do well in the future I appreciate everything you have added to my knowledge base.
This blog post is excellent, probably because of how well the subject was developed. I like some of the comments too though I could prefer we all stay on the subject in order add value to the subject!
cheap essays writing service
essay on helping poor people
professional essay editing service
I just couldnt leave your website before saying that I really enjoyed the useful information you offer to your visitors… Will be back often to check up on new stuff you post!
essays services
buy cheap essays online
professional essay writer
I am very happy to look your post. Thanks a lot and i am taking a look ahead to touch you.