利用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"}); }
I absolutely adore your site! You aggressive me as able-bodied as all the others actuality and your broiled PS is absolutely great!
gay webcam chat software
gay chat room finding sex
chat gay con camara
you’re in reality a just right webmaster. The web site loading velocity is incredible. It sort of feels that you’re doing any distinctive trick. In addition, The contents are masterpiece. you’ve performed a great process on this topic!
OK, you outline what is a big issue. But, can’t we develop more answers in the private sector?
Hi there, just became aware of your blog through Google, and found that it’s truly informative. It’s important to cover these trends.
I’d like to be able to write like this, but taking the time and developing articles is hard…. Takes a lot of effort.
You are my inspiration , I possess few web logs and very sporadically run out from to brand 🙁
That is really fascinating, You’re an excessively skilled blogger. I’ve joined your rss feed and look forward to in the hunt for extra of your magnificent post. Additionally, I’ve shared your website in my social networks!
Nice piece of info! May I reference part of this on my blog if I post a backlink to this webpage? Thx.
This is an awesome entry. Thank you very much for the supreme post provided! I was looking for this entry for a long time, but I wasn’t able to find a honest source.
I am glad to be a visitor on this website!, regards for this rare information!
Thanks pertaining to discussing the following superb written content on your site. I ran into it on the search engines. I will check back again if you publish extra aricles.
Saw your material, and hope you publish more soon.
gay danish english chat rooms
gay chat rooms of pa
hairy gay men chat free
buy generic isotretinoin
Your resources are well developed.
whoah this weblog is wonderful i like reading your articles. Keep up the good paintings! You already know, many people are looking around for this information, you can help them greatly.
no deposit online casino bonus
win real money online casino for free
online casino usa
dating single
flirt singles
dating single
A wholly agreeable point of view, I think primarily based on my own experience with this that your points are well made, and your analysis on target.
Lewabo is a multicultural inspirational movies website. Enjoy hundreds of inspiring, uplifting, positive family-friendly movies. Action, Thrillers, Romance, Family drama, Kids, Faith, Comedy and more. An entertainment platform for the whole family. African films, American films, films from different countries, Nigerian nollywood films, South african films, Christian movies, Documentaries. Lewabo is good content entertainment. Hundreds of titles. 70% exclusive content.
free bonus no deposit casino
online gambling sites no deposit
online casinos for usa players
I would share your post with my sis.
Is it okay to put a portion of this on my weblog if perhaps I post a reference point to this web page?
free online adult dating site
meetme dating site
online dating single