2
在AS2中,我只需添加一個stop();進入clickTag,但我不確定AS3中我會這樣做。在AS3中點擊後停止所有動畫
這裏是我的clickTag的示例代碼
package
{
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
public class main300x250 extends MovieClip
{
public var paramList:Object;
public function main300x250()
{
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
myBTN.addEventListener(MouseEvent.CLICK, clickHandler);
myBTN.addEventListener(MouseEvent.ROLL_OVER, clickOver);
myBTN.addEventListener(MouseEvent.ROLL_OUT, clickOut);
TweenNano.from(t1, .5, {alpha:0, scaleX:0, scaleY:0, ease:Back.easeOut, delay:0});
TweenNano.to(t1, .5, {scaleX:0, scaleY:0, ease:Back.easeIn, delay:1.75});
TweenNano.from(f2.a, .35, {y:"+35", alpha:0, delay:2.25});
TweenNano.from(f2.b, .35, {y:"+35", alpha:0, delay:2.4});
TweenNano.from(f2.nugsL, .5, {x:"-200", ease:Quad.easeIn, delay:2.75});
TweenNano.from(f2.nugsR, .5, {x:"+200", ease:Quad.easeIn, delay:3.15});
TweenNano.to(f2.a, .25, {y:"+15", alpha:0, delay:5.5});
TweenNano.to(f2.b, .25, {y:"+15", alpha:0, delay:5.65});
TweenNano.from(f3.a, .35, {y:"+35", alpha:0, delay:5.75});
TweenNano.to(f2.nugsL, .5, {x:6.5, y:30.5, ease:Quad.easeIn, delay:6.2});
TweenNano.to(f2.nugsR, .5, {x:6.5, y:30.5, ease:Quad.easeIn, delay:6.2});
TweenNano.from(f3.d, .5, {x:"-20", y:"+20", alpha:0, delay:6.6});
TweenNano.to(f3.a, .25, {y:"+15", alpha:0, delay:8.75});
TweenNano.to(f2.nugsL, .25, {x:"+350", delay:8.9});
TweenNano.to(f2.nugsR, .25, {x:"+350", delay:8.9});
TweenNano.to(f3.d, .15, {alpha:0, delay:9});
TweenNano.from(t2, 0.65, {delay:9.15, y:'+='+250, ease:Back.easeOut});
TweenNano.from(t2.a, 0.2, {delay:9.25, y:'+='+75});
TweenNano.from(t2.b, 0.2, {delay:9.45, y:'+='+75});
TweenNano.from(t2.c, 0.2, {delay:9.45, y:'+='+75});
TweenNano.to(t2.b, 0.25, {delay:10.2, x:"-30"});
TweenNano.to(t2.c, 0.25, {delay:10.2, x:"-30"});
TweenNano.to(t2.d, 0.25, {delay:10.2, alpha:1, x:"+31"});
TweenNano.to(endLockUp, 1, {delay:10.2, scaleX:1.15, scaleY:1.15, ease:Quad.easeIn});
TweenNano.from(endLockUp.a, 0.2, {delay:10.2, y:"+200"});
TweenNano.from(endLockUp.b, 0.2, {delay:10.4, x:"-200"});
TweenNano.from(endLockUp.c, 0.2, {delay:10.4, x:"+200"});
TweenNano.from(endLockUp.d, 0.2, {delay:10.6, x:"-200"});
TweenNano.from(endLockUp.e, 0.2, {delay:10.6, x:"+200"});
TweenNano.from(endLockUp.f, 0.2, {delay:10.8, x:"-200"});
TweenNano.from(endLockUp.g, 0.2, {delay:10.8, x:"+200"});
TweenNano.from(endLockUp.h, 0.2, {delay:11, x:"-120"});
TweenNano.from(endLockUp.i, 0.2, {delay:11, x:"+120"});
TweenNano.to(endLockUp, 0.2, {delay:11.2, scaleX:1, scaleY:1});
TweenNano.from(cta, .5, {y:"+200", ease:Back.easeOut, delay:11.4});
TweenNano.from(logo, .15, {y:-62.65 , delay:11.85});
TweenNano.from(legal, .1, {alpha:0, delay:11.9});
}
private function clickOver(e:MouseEvent):void
{
TweenNano.to(cta, .25, {scaleX:1.15, scaleY:1.15});
}
private function clickOut(e:MouseEvent):void
{
TweenNano.to(cta, .25, {scaleX:1, scaleY:1});
}
function clickHandler(e:MouseEvent):void {
var click_url:String = root.loaderInfo.parameters.clickTAG;
if(click_url) {
navigateToURL(new URLRequest(click_url), '_blank');
TweenNano.stop();
}
}
}
}
動畫嵌套到另一個文件中。作爲編輯 :粘貼整個文件。作爲代碼。
在此先感謝。
取代它不幸的是,既不工作 – user3593810
你作爲對象傳遞了什麼? – user2136963
它應該是你想要停止的movieclip或它的父母。或者你沒有參考這樣的剪輯? – user2136963