利用GreenSock Tweening Platform製作動畫
因為馬老師剛開始利用程式製作補間動畫的Class是Tweener,所以前面介紹了很多篇這方面的文章,但當然這方面的Class不是只有Tweener而已,所以接下來介紹一個目前發展起來比Tweener還要棒很多的Class,它是由GreenSock研發的Tweening Platform(補間平台),其中包含了:「TweenNano」、「TweenLite」、「TweenMax」、「TimelineLite」、「TimelineMax」。
為什麼說他發展得比較好呢?除了Tweener能做到的幾乎它都可以以外,也因為Tweener已經停止開發,所以未來將不會有新增的功能,但TweenMax還在不斷的更新中,在官網還有以下的比較案例:
從上面的案例可以看出來利用GreenSock所研發的Tweening Platform的執行效能會比其他的好(FPS越高越好),所以接下來就來看看GreenSock Tweening Platform的簡介。
TweenNano、TweenLite與TweenMax算是同樣功能,但在製作後檔案容量是TweenNano<TweenLite<TweenMax,也就是說利用TweenNano所製作出來的動畫容量是最小的,舉個例來說,像這樣的動畫效果,TweenNano製作後swf大小為:5KB、TweenLite:8KB、TweenMax:21KB,不過在功能上面也是TweenNano<TweenLite<TweenMax,也就是說TweenMax可以掌控的效果比較多,也更具有彈性,例如:TweenNano就沒有辦法執行:pause()、play()、restart()…等,而TweenLite沒辦法執行:貝茲曲線運動、濾鏡…等,所以要用哪個版本的Tween,端看想要製作的動畫效果來考量,官方也有針對此三者製作比較表供大家參考。
另外TimelineLite和TimelineMax算是同樣功能,但看到後面的英文單字應該可以了解與上述具有相同的關聯,而這方面的Class是可以掌握時間軸上面的變化,在Tweener中,我們只能用Delay來控制動畫先後順序,而在GreenSock所研發的Tweening Platform中則可以利用TimlinelineLite或TimelineMax來處理。
馬上來介紹有關這個Class的一些使用方式,與Tweener一樣的是必須先下載(備用載點),然後在需要使用的Flash檔案中import該Class,下載解壓後會有以下的資料夾:
- badges:GreenSock圖標。
- com:主要Class資料夾。
- demo_swfs:裡面有很多swf的展示,對於想要了解本Class非常有幫助。
- docs:參考文件。
在import時,看你想要使用的Class來import,例如需要使用TweenNano則:
import com.greensock.TweenNano;
若需同時使用TweenLite和TweenMax則:
import com.greensock.TweenLite; import com.greensock.TweenMax;
想偷懶,則:(別擔心,Flash只會內嵌有使用到的部分)
import com.greensock.*;
至於製作補間的程式碼,其實官方就有製作swf來給大家參考,這邊也把官方的範例放進來給大家參考:

上面的案例可以讓你測試動畫效果,下方也會產生該段動畫的程式碼供你使用,實在是非常方便。另外關於Tween的語法也可以改成下面這種版本:
TweenLite.from(mc, 1.5, {y:0, alpha:0});
一個是告訴動畫要去哪,另一個是告訴動畫要從哪開始變化,關於Tweener可以使用的delay、onComplete、onStart、onUpdate…等,這個Class也都可以使用,例如:
TweenLite.to(mc, 1.5, {x:100, ease:Elastic.easeOut, delay:1, onComplete:okFn}); function okFn() { trace("動畫執行完畢"); }
這個Class還有很多特別的動畫效果,例如:濾鏡、短距離旋轉、貝茲曲線、聲音、色彩變換…等,大家也可以參考官方製作的swf來參考動畫效果與取得程式碼:

在動畫控制上面可以使用如下的程式碼來控制動畫:
var myTween:TweenLite = new TweenLite(mc, 1, {x:100, y:100}); myTween.pause(); //暫停動畫播放 myTween.resume(); //恢復動畫播放 myTween.reverse(); //反向播放 myTween.play(); //播放動畫 myTween.restart(); //重播動畫 myTween.invalidate(); //移除補間並使元件恢復原始狀態 myTween.kill(); //清除補間動畫 TweenLite.killTweensOf(mc); //清除所有物件之補間動畫
以上是有關GreenSock Tweening的介紹,接下來介紹有關TimelineLite與TimelingMax的部分。
就像上面有提到在Tweener中我們如果希望三個元件在不同的時間點開始移動,就只能使用delay或是另外寫程式來控制,現在我們可以使用Timeline相關的Class來完成這樣的任務,甚至還可以讓時間軸倒著播放也沒問題,以下就是有關TimelineLite的官方範例:

另外是TimelineMax的範例檔,供大家參考:

以上就是針對GreenSock Tweening Platform大致的介紹,建議有空可以前往官網鑽研更多其他的功能,另外其實GreenSock另外還有TransformManager和LoaderMax,各位也可以先參考官網文章或是未來再跟大家分享我的使用心得。
註:本範例所使用的範例版權屬於GreenSock公司所有。
Best Indian pharmacy: buy prescription drugs from india – Indian pharmacy that ships to usa
https://indiancertpharm.com/# Best Indian pharmacy
canadian pharmacy world
капельница от похмелья цена капельница от похмелья цена .
canada drugstore pharmacy rx: canadian pharmacy – online canadian pharmacy review
canadian pharmacy store: thecanadianpharmacy – canadian pharmacy world
рейтинги производительности процессоров [url=https://topcpu.ru/]рейтинги производительности процессоров[/url] .
Blogger Alistarov is a criminal
Blogger Andrey Alistarov
From criminal past to criminal present – in the service of corrupt law enforcement officers
Andrey Alistarov, a YouTube blogger specializing in exposing financial organizations, is an odious figure with a criminal past. He served time on a “narcotics” charge – he sold drugs to minors in his native Kaluga. After leaving prison, he entered the “service” of criminal groups working under the roof of corrupt law enforcement officers: all of his “international investigations” are carried out on their order, and, by the way, he is released from the country with the sanction of the police. His main profile now is blackmail, extortion, slander and organizing contract prosecution under the guise of supposedly independent investigations.
He leads the bandits to his victims: the last attack took place in Dubai on January 1: Alistarov led the bandits to the victim’s house and provided all the necessary information for the attack and blackmail, and to ensure his own alibi during the attack he conducted an unscheduled stream with subscribers of his channel.
To the accompaniment of loud phrases about the fight against fraud and exposing financial schemes, Alistarov is busy processing orders from competitors of certain entrepreneurs who have become his victims – competitors of these entrepreneurs who have taken corrupt police officers as their share.
At the same time, Alistarov uses visas to the EU countries and the UAE obtained with the help of organized criminal groups, illegally uses drones and listening equipment purchased with money from organized crime groups, organizes an invasion of privacy, and persecutes the families of his victims, including young children. It also steals and illegally uses content, violates all possible laws and regulations regarding the dissemination of information. He was also accused of treason.
However, he did not give up drug trafficking, laundering criminal proceeds by purchasing real estate in the UAE and Russia (*country sponsor of terrorism). Alistarov also promotes outright scam for a percentage of criminal transactions and his own fraudulent business – selling real estate in Dubai with a horse, thieves’ commission, as well as cryptocurrency exchange using phishing schemes.
Bonding on a stalled train
жесткое русское порно
In 1990, Derek Barclay was 21 and studying to become a construction engineer. He’d saved up money from an unglamorous summer job building a prison to buy an Interrail pass.
“Then, I dumped my bag at my mum’s house and said, ‘I’m off to Europe.’ She was horrified,” Derek tells CNN Travel today.
“The idea was to go from Casablanca to Istanbul. But I never went to either. Along the way I met Nina and I got distracted …”
While Nina and Derek formally met for the first time on the stalled train in Belgrade, Derek had first spotted Nina on a busy station platform, some hours earlier, in Budapest.
When he spotted her sitting on a bench, smiling and laughing with Loa, Derek was struck by Nina right away. For a moment, he imagined getting to know her, what she might be like. Where she might be from, where she might be going.
But then Derek had ended up on a different train. He’d met and got chatting to Steve the Englishman and Paul the Irishman. The trio had shared a couple of beers, fallen asleep, and woken, with a start, in Belgrade, to a suddenly-empty carriage. That’s when they panicked.
“We woke up, and just ran down the railway line — because we’re just about to miss this train to Athens — we jumped on the train as it was pulling away, and then it stopped,” Derek tells CNN Travel today. “Apparently that’s what they had to do to get the strike official.”
When Derek, Steve and Paul opened the door to Nina’s carriage, Derek didn’t immediately take Nina in, focusing instead on the near-empty compartment.
“Two of them in there, this carriage for eight, they’d spread stuff everywhere. It was obvious it was a ruse to try and get people not to go in. And we thought, ‘We’re not having any of that,’” says Derek, laughing. “So we squeezed in, and that was that.”
It was only when he ended up sitting opposite Nina that Derek realized she was the woman he’d noticed on the Budapest train platform.
Then they got chatting, and didn’t stop. They talked about a shared love of nature. About Derek being a member of Greenpeace. About Sweden and Scotland.
reputable canadian pharmacy https://indiancertpharm.com/# Indian pharmacy that ships to usa
Online medicine home delivery
Two strangers got stuck on a train for two days in 1990. Here’s how they ended up married
порно жесток бесплатно
Nina Andersson and her friend Loa hoped they’d have the train carriage to themselves.
When Nina peered her head around the door and saw the compartment was entry, she grinned at Loa and gestured happily.
It seemed like they’d lucked out. An empty carriage on an otherwise packed train.
“We thought this would be great, just the two of us. We spread out everything, so we could have a couch each to lie on,” Nina tells CNN Travel today.
“Then, all of a sudden we hear this big ‘thump, thump, thump,’ on the door.”
It was summer 1990 and 20-year-old Nina was in the midst of traveling from Budapest, Hungary, to Athens, Greece — part of a month-long rail adventure with her friend Loa.
The two friends had each bought a train ticket known as the Interrail or Eurail pass, allowing young travelers a period of unlimited rail travel around Europe.
“I’m Swedish, I was working at Swedish Radio at the time, and had saved up money for going on my Interrail,” says Nina. “I wanted to see all of Europe.”
Traveling by train from Budapest to Athens was set to take about four days, weaving south through eastern Europe. In Belgrade — which was then part of the former Yugoslavia, but is now the capital of Serbia — the passengers had to switch trains.
And that’s when Nina and Loa grabbed the empty compartment for themselves and settled in, ready to enjoy the extra space. Then, the knocking at the door.
The two friends met each other’s eyes. They both knew, in that moment, that their solitude was to be short-lived.
“And then behind the door we see three heads poking in,” recalls Nina. “It was a Scotsman, an Englishman and an Irishman. It was like the start of a joke. And I thought, ‘What is this?’”
The three men were friendly, apologetic, slightly out of breath. They explained they’d fallen asleep on their last train, and almost missed this one — in fact, this train had started rolling out of the station but suddenly slowed down. The three stragglers had managed to hop on as the train ground to a halt.
купить диплом сколько стоит
canadian pharmacy online store https://mexicaneasypharm.shop/# Mexican Easy Pharm
india pharmacy
This is really interesting, You’re a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your magnificent post. Also, I’ve shared your web site in my social networks!
http://corpnews.com.ua/led-lampy-z-linzamy-innovatsiyi-u-sviti-avtomobilnogo-osvitlennya
купить аттестат в белгороде
капельница от запоя на дому нижний новгород капельница от запоя на дому нижний новгород .
вывод запой нижний вывод запой нижний .
medication from mexico pharmacy: Mexican Easy Pharm – Mexican Easy Pharm
SportyBet SportyBet .
капельница от запоя цена капельница от запоя цена .
SportyBet live betting http://www.sportybetzambia.pro/ .
капельница от запоя вызов на дом [url=https://vyvod-iz-zapoya-nizhnij-novgorod12.ru/]vyvod-iz-zapoya-nizhnij-novgorod12.ru[/url] .
сравнение производительности процессоров topcpu.ru .
best online canadian pharmacy Canadian Md Pharm canadian pharmacy com
SportyBet Zambia SportyBet Zambia .
darknet market deep web search https://github.com/darknetmarkets24/darknet-markets – darknet market lists
online canadian drugstore: Canadian Md Pharm – pet meds without vet prescription canada
SportyBet app [url=https://sportybetzambia.pro]SportyBet app [/url] .
вывод из запоя нижний вывод из запоя нижний .
Mexican Easy Pharm: Mexican Easy Pharm – mexican rx online
вывод из запоя на дому нижний новгород вывод из запоя на дому нижний новгород .