利用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’ll Never Be Able To Figure Out This Upvc Window Repairs Near Me’s Tricks Upvc Window Repairs Near Me
Guide To Window Repair: The Intermediate Guide On Window Repair window
repair – Marty,
The Reasons You Should Experience Double Glazed Replacement Windows At A Minimum, Once
In Your Lifetime glass Windows Replacement near Me
The 10 Most Scariest Things About Upvc Window Repairs upvc window repairs near me
20 Things You Should Ask About Bunk Beds For Children Before You
Decide To Purchase It Joe
You’ll Never Guess This Window Repair Near Me’s Tricks window repair near me –
Sienna –
Why Nobody Cares About Bedford Door And Window Transom Window Repair
The 10 Scariest Things About Semi Truck Lawsuits semi truck Accident lawsuit
5 Killer Quora Answers On Single Pushchair single pushchair
A Peek Into The Secrets Of Truck Lawyers Near Me truck accident Attorney
The 10 Most Terrifying Things About Personal Injury Attorneys personal injury attorneys
I’ve never commented on a blog post before, but I couldn’t resist after reading yours. It was just too good not to!
Double Glazing Repairs Near Me Tips To Relax Your Everyday Lifethe Only Double Glazing Repairs
Near Me Trick That Every Person Must Know double glazing Repairs Near me
cyclophosphamide medication – purchase zerit pills buy trimetazidine cheap
Ten Things You Learned About Kindergarden To Help You Get Started With Adhd Symptoms Adults Test Low Dopamine Symptoms Adhd [Mournheim.Com]
Are Car Locksmith Near Me The Best Thing There Ever Was?
Elsy Crays
Ten Myths About Birth Injury Settlement That Aren’t Always The
Truth Birth injuries
Three Greatest Moments In All Terrain Wheelchair Electric History electric
automatic wheelchair, Joann,
The Best Get An ADHD Diagnosis It’s What Gurus Do
Three Things Adhd Underdiagnosis
Five Killer Quora Answers To Best Lightweight Single Stroller Best Lightweight Single Stroller
12 Companies Leading The Way In Bedford Door And Window window Restoration bedford
10 Beautiful Images To Inspire You About Real Leather Sofa small leather corner Sofa
20 Fun Facts About 10kg Washing Machines Uk 023456789
See What Railroad Injuries Lawsuit Tricks The Celebs Are Using
Railroad Injuries Lawsuit
7 Simple Secrets To Totally Rocking Your Birth Defect
Attorney Birth Defect Law Firm
The Guide To Semi Truck Lawyer In 2023 semi truck accidents (sun-clinic.co.il)
20 Myths About Metal L Shaped Bunk Beds: Busted l-shaped bunk beds
Five Killer Quora Answers To Auto Accident Attorneys Auto Accident
How To Make An Amazing Instagram Video About Double Glazing Doctor
Near Me Double Glazed Replacement Units
20 Semi Truck Lawyer Websites That Are Taking The Internet By Storm Semi truck Accident attorneys