利用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"}); }
You should be a part of a contest for one of the best sites on the web. I am going to highly recommend this website!
Bank Secured Credit Card 다바오 투어
Spot on with this write-up, I seriously think this website needs a lot more attention. I’ll probably be returning to read through more, thanks for the information!
I couldn’t agree more with your conclusions.오피
prawo jazdy kat a2
Carrier Oils For Massage With Essential Oils 북구오피 (lf.yadingtour.com)
ремонт фотоаппаратов недорого
Looking for professional drain cleaning? Brazos Plumbing in League City offers thorough and reliable drain cleaning services for homes and businesses. Drain cleaning
I want to to thank you for this very good read!! I definitely enjoyed every little bit of it. I’ve got you saved as a favorite to look at new things you post…
A Checklist For Preparing For A Memorable Party 수성구오피
I really love your site.. Pleasant colors & theme. Did you develop this site yourself? Please reply back as I’m trying to create my very own site and would like to learn where you got this from or what the theme is called. Kudos.
You are so interesting! I don’t suppose I’ve truly read anything like this before. So nice to discover someone with genuine thoughts on this subject matter. Seriously.. thanks for starting this up. This website is something that is needed on the internet, someone with a little originality.
I used to be able to find good advice from your content.
A Post On The Fujikura 1000 Shiatsu Massage Chair 부산오피
Saved as a favorite, I like your blog.
I love how you write, it had me thinking. I??m going to bookmark this.
Aw, this was an extremely nice post. Taking a few minutes and actual effort to generate a good article… but what can I say… I procrastinate a lot and don’t seem to get nearly anything done.
I am commenting to let you know what a exceptional experience my wife’s child enjoyed viewing your webblog. She picked up many details, with the inclusion of what it is like to have an amazing giving mindset to make a myriad of people effortlessly have an understanding of a variety of specialized subject matter. You honestly inspired her. Thank you for offering the important, safe, edifying not to mention easy pointers regarding your subject to Evelyn. Thanks,
Get A Great Go On Bank Fees 프리랜서 대출
bookmarked!!, I love your website!
Very Good blog im interested for about that
This post is incredibly informative. I genuinely enjoyed going through it. The details is extremely arranged and straightforward to follow.
As I web-site possessor I believe the content material here is rattling wonderful , appreciate it for your efforts. You should keep it up forever! Best of luck. Rent a car kosova
Can I just say what a relief to find a person that truly knows what they’re discussing over the internet. You definitely understand how to bring a problem to light and make it important. More people must read this and understand this side of the story. I was surprised you’re not more popular because you certainly have the gift.
The two dining establishments beneath the bridge are Snoopy’s and Doc’s. Snoopy’s seems to be the much more remarkably regarded, but we do not comprehend why. Snoopys is just a fried fish-shack. You order at the counter and select up your unique meals served on paper plates. It is money only, and it has no bar just beer. Doc’s has waiters, real plates, and a complete bar. They each have terrific sunset views about the lagoon, but neither appeared to have air-conditioning.
A motivating discussion is definitely worth comment. I do think that you should write more on this topic, it might not be a taboo subject but typically people don’t speak about these issues. To the next! All the best.
prawo jazdy kat c+e koszt calkowity
Greetings, Could I grab your own photograph and make use of it on my own blog page?
I visited a lot of website but I think this one has got something extra in it in it
Hello! I just want to give you a huge thumbs up for your excellent info you have here on this post. I’ll be returning to your site for more soon.