利用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"}); }
10 Things You’ve Learned From Kindergarden That’ll Help You With Main Sweet Bonanza Demo demo slot Pragmatic sweet bonanza rupiah
Unexpected Business Strategies Helped Licensed Slots Achieve Success themed slot games (Nelly)
9 Lessons Your Parents Teach You About Window Doctor Near Me window doctor near
me (Louann)
It’s nearly impossible to find knowledgeable individuals within this topic, however you sound like you know what you are speaking about! Thanks
Why Nobody Cares About Slot Symbols Slot strategy
This Is The Advanced Guide To Slot Sound Effects Slot wins
Do You Think Diagnosis For ADHD Always Rule The World?
how To diagnosis adhd in adults (9d0br01aqnsdfay3c.Kr)
You’ll Be Unable To Guess Adult Adhd Assessment
Uk’s Benefits Adhd Assessment Uk
Five Killer Quora Answers On Tier 1 Seo Tier 1 Seo
The Under-Appreciated Benefits Of Double Pushchair Sale Pushchairs And Prams
How To Make A Profitable Why Are CSGO Skins Going
Up In Price Entrepreneur Even If You’re Not Business-Savvy
cs2 Cases
20 Tips To Help You Be Better At Treadmills For Sale shop
5 Killer Quora Answers On Semi Truck Case semi Truck Accident Law Firm
How To Make A Profitable Dangerous Drugs Lawsuits Even If You’re Not Business-Savvy Dangerous drugs Attorney
Five Killer Quora Answers To Act Fela Act fela
10 Unexpected Slot Tips Tips slots for real Money (frederick-chase-3.blogbright.net)
The 10 Most Scariest Things About Car Accident Attorneys Car Accident Attorneys
Everything You Need To Learn About Window And
Door Company Near Me repairing
What’s The Current Job Market For Which Is The Best Online Supermarket Professionals Like?
which is the best online supermarket (Roman)
5 Killer Quora Answers On Shopping Online Sites List
shopping online sites list (http://loungemall.co.kr/)
What’s The Current Job Market For Shopping Online Uk
Professionals Like? Shopping Online uk
10 Tips For Semi Truck Compensation That Are Unexpected semi truck accident law firms
Why No One Cares About Auto Accident Attorney Auto accidents
How Do I Explain Semi Truck Case To A 5-Year-Old semi truck accident
See What Adhd Assessment Tricks The Celebs
Are Using Adhd assessment
What Is The Reason? Patio Glass Door Repair Near Me Is Fast Increasing To Be
The Hottest Trend Of 2023 replacement
What’s The Current Job Market For Double Glazed Window Repairs
Professionals Like? double glazed window repairs
5 Must-Know Slot Developers Practices For 2023 Top Slots
15 Twitter Accounts You Should Follow To Find Out More About Upvc Doors Repair
repair upvc door (http://jnktc.com/bbs/board.php?bo_table=free&wr_id=47888)
You’ll Never Be Able To Figure Out This Renault Zoe Key’s
Benefits renault zoe key