TweenMax sample code
来源:互联网 发布:顶级域名有几种类型 编辑:程序博客网 时间:2024/04/29 09:13
//import the GreenSock classesimport com.greensock.*;import com.greensock.easing.*; //tween the MovieClip named "mc" to an alpha of 0.5 over the course of 3 secondsTweenMax.to(mc, 3, {alpha:0.5}); //scale myButton to 150% (scaleX/scaleY of 1.5) using the Elastic.easeOut ease for 2 secondsTweenMax.to(myButton, 2, {scaleX:1.5, scaleY:1.5, ease:Elastic.easeOut}); //tween mc3 in FROM 100 pixels above wherever it is now, and an alpha of 0. (notice the vars object defines the starting values instead of the ending values)TweenMax.from(mc3, 1, {y:"-100", alpha:0}); //tween mc4 from x:100 to x:300 while changing its tint from whatever it is when the tween starts to red (0xFF0000)TweenMax.fromTo(mc4, 1, {x:100}, {x:300, tint:0xFF0000}); //after a delay of 3 seconds, tween mc for 5 seconds, sliding it across the screen by changing its "x" property to 300, using the Back.easeOut ease to make it shoot past it and come back, and then call the onFinishTween() function, passing two parameters: 5 and mcTweenMax.to(mc, 5, {delay:3, x:300, ease:Back.easeOut, onComplete:onFinishTween, onCompleteParams:[5, mc]});function onFinishTween(param1:Number, param2:MovieClip):void { trace("The tween has finished! param1 = " + param1 + ", and param2 = " + param2);} //call myFunction() after 2 seconds, passing 1 parameter: "myParam"TweenMax.delayedCall(2, myFunction, ["myParam"]); //tween every MovieClip in the "letters" Array up 100 pixels (changing their "y" property to a relative value of "-100") over 2 seconds while fading out, and stagger the start time of each tween by 0.1 seconds. There could literally be hundreds of MovieClips in the "letters" Array and this one line of code would tween them all!TweenMax.allTo(letters, 2, {y:"-100", alpha:0}, 0.1); //use the object-oriented syntax to create a TweenMax instance and store it so we can reverse, restart, or pause it later. Make it repeat twice with a 1-second delay between each repeat cycle.var myTween:TweenMax = new TweenMax(mc2, 3, {y:200, repeat:2, repeatDelay:1, onComplete:myFunction}); //some time later (maybe in by a ROLL_OUT event handler for a button), reverse the tween, causing it to go backwards to its beginning from wherever it is now.myTween.reverse(); //pause the tweenmyTween.pause(); //restart the tweenmyTween.restart(); //make the tween jump to its halfway pointmyTween.currentProgress = 0.5;
0 0
- TweenMax sample code
- sample code
- TweenMax
- TweenMax
- TweenMax
- Tweenmax
- JDK 1.5 Sample Code
- Events Sample Code(1)
- Events Sample Code(2)
- logic font sample code
- MetaWeblogAPI C# Code Sample
- JavaScript Sample Code
- XMl - xerces code sample
- java concurrent code sample
- Sample CRC Code
- sample code of webview
- Spring AOP Sample Code
- sample transaction code
- samba 共享权限设置的问题
- [深入浅出Cocoa]详解键值观察(KVO)及其实现机理
- 数据结构实验图论一:基于邻接矩阵的广度优先搜索遍历
- 无利不起早,360为何积极宣传要防护XP?
- 继承View类,onDraw()方法的调用时间
- TweenMax sample code
- 在Myeclipse中启动tomcat时会出现debug
- C++学习笔记
- 【刷机】GS3刷机
- c++函数模板
- 一起学习水晶报表之【如何实现Web网页显示水晶报表和绑定数据】(课程1)
- 黑马程序员--基础加强--第七篇--注解
- TweenMax学习整理--特有属性
- hql查询实例