利用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"}); }
20 Resources To Make You More Effective At Play Slots Online kaymell.uk
10 Drip Coffee-Friendly Habits To Be Healthy Drip Filter Coffee
10 Tell-Tale Signs You Need To Get A New Malpractice Claim Malpractice Attorney
Why You Should Concentrate On Improving Responsible Pet Care https://www.836614.xyz
How To Design And Create Successful Medical Malpractice Settlement Techniques From Home lawyer
See What Veterans Disability Lawyer Tricks The Celebs Are Utilizing Veterans disability
Fiat 500 Key: The Ultimate Guide To Fiat 500
Key fiat Punto evo key
You’ll Never Be Able To Figure Out This Foldable Treadmill’s
Tricks http://www.zackfoxworth.top
5 Killer Quora Answers To Private Psychiatrist London private psychiatrist london
The No. Question That Everyone In Boot Mobility Scooter
Must Know How To Answer collapsible knee scooter (Sharon)
20 Tools That Will Make You Better At Double Glazed Window
Repairs Near Me double glazing repair near me
Watch Out: How Veterans Disability Attorney Is Taking Over And What We Can Do About It
veterans Disability law firms
5 Killer Quora Answers On Double Glazed Window
Repairs Near Me double glazed Window repairs near me
Five Tools Everybody Who Works In The Malpractice Legal Industry Should Be Utilizing attorney
The 10 Scariest Things About Double Glazing Firms Near Me double glazing firms near me (https://www.damaon.Kr)
20 Trailblazers Leading The Way In Locksmith For A Car elsycrays
5 Killer Quora Answers On Double Glazed Window Repairs Near Me double glazed window
repairs near me (Everett)
The Infrequently Known Benefits To Vehicle Diagnostics bmw Diagnostic (http://freeflashgamesnow.com/profile/2691175/TereseHupp)
The 10 Scariest Things About Blown Double Glazing Repairs Near Me
double glazing repairs near me (pipewiki.org)
The 10 Most Terrifying Things About Medical Malpractice Compensation Medical malpractice attorney
Why No One Cares About Pet Care Online 836614
You’ll Never Be Able To Figure Out This Double Glazing Windows Near Me’s Tricks Double Glazing Windows Near Me
Repairs To Upvc Windows: What’s No One Is Talking About window repair (Wilda)
A Proficient Rant Concerning Double Glazed Doors Near Me Local
10 Quick Tips For Mini Sectional Sofa https://www.4452346.xyz/
5 Killer Queora Answers On Private Psychiatrist
Glasgow london private Psychiatrist
Five Killer Quora Answers On Replacement Double
Glazing Units Near Me Replacement Double Glazing Units Near Me
What The 10 Most Worst Treating ADD In Adults Errors Of All Time Could Have Been Prevented treatment for add Adhd in adults
15 Terms That Everyone Involved In Lavazza Coffee Machine Industry Should Know http://www.4182051.xyz
A Brief History Of Assessment Of Adult Adhd
History Of Assessment Of Adult Adhd adhd Assessment for adults near me
(http://www.chunwun.Com/bbs/board.Php?bo_table=qna_Ko&wr_id=607883)