利用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"}); }
Your resources are well developed.
cost of ivermectin medicine ivermectin 5 mg price ivermectin 4000 mcg
ivermectin 20 mg ivermectin eye drops stromectol tablets buy online
bi gay chat rooms
black bottom gay chat room
free gay chat rooms by zip code
This is really interesting, You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your great post. Also, I’ve shared your web site in my social networks!
I wish I could craft such articles as this. Thank you very much.
order pregabalin pregabalin 150mg sale purchase pregabalin generic
lyrica uk buy pregabalin 150mg without prescription pregabalin drug
effexor 150mg us buy venlafaxine 75 mg pill buy effexor online cheap
Excellent article!! I am an avid reader of your website:D keep on posting that good content. and I’ll be a regular visitor for a very long time!!
I found your blog through google and I must say, this is probably one of the best well prepared articles I have come across in a long time. I have bookmarked your site for more posts.
I think this is among the so much vital info for me. And i’m happy reading your article. But wanna remark on few common issues, The site style is wonderful, the articles is really excellent : D. Just right job, cheers
effexor usa order venlafaxine for sale buy venlafaxine pill
We’re developing a conference, and it looks like you would be a great speaker.
effexor 150mg drug buy venlafaxine 150mg for sale effexor 75 mg generic
venlafaxine generic venlafaxine 75 mg oral effexor 150mg us
free gay web cam chat rooms
free live gay webcam chat rooms
indian gay chat room
The post is absolutely great! Lots of great info and inspiration, both of which we all need! Also like to admire the time and effort you put into your blog and detailed information you offer! I will bookmark your website!
cleveland gay chat
free gay sex chat on camera
gay daddies free chat
This is a great blog. Thank you for the very informative post.
Thank you, I have just been searching for information about this topic for ages and yours is the greatest I’ve discovered till now. But, what about the conclusion? Are you sure about the source?
Best American Healthcare University online surgical technician training is far superior to other online Surgical Technician programs because it includes the training, exam review and national certification exams. Register with Confidence and attend a nationally accredited, but affordable program. In just 4 months, you can complete the surgical technician program from the comfort of your home without a loan on your neck. Enroll now at https://www.bestamericanhealthed.com/surgical-technician