Tweenmax是TweenLite和TweenFilterLite的基础上建立的。目的在于使得tweening家族具备更加大众化的功能......Tweenmax同样使用简单易学的语法。实际上,因为Tweenmax是演化版,所以TweenMax可以实现TweenLite和 TweenFilterLite的所有功能,或者更多。那么,你可能要问,为什么不仅仅弄一个类呢?这是个很好的问题。这是因为我们的目的在于用最小的代码实现最好的效果。坦白说,90%的项目可能需要TweenLite,一个3K的类。这使得整个项目非常高效率地简单的实现需要的效果。但是如果你需要 tween filters或者更多的效果......就要用到6K大小的TweenFilterLite。还要更多功能?没问题,使用9K大小的(看起来十分臃肿的?)TweenMax实现更多功能。下面的列表展示了这三个类之间的不同之处。TweenMax引入了一项创新的功能,叫做 "bezierThrough",一个能够让你通过运动曲线定义相关的点(而不是用普通的方法......)又或者用有规律的贝赛尔曲线-只要你愿意。它甚至会处理你的物体的旋转,来调整你的方向。看看下面的例子吧。点击添加贝赛尔点。

方法

TweenMax.to(target:Object, duration:Number, variables:Object):TweenMax 
-- 描述:让你的物体的属性从你声明这个方法时的状态变到任何你设定的效果。 
-- 参数: 
          ---- target:Object :你想要实现动画的目标物体 
          ---- duration:Number :整个过程的时间(seconds) 
          ---- variables:Object :一个包括最终的所有你想得到的属性(如果你正在用TweenMax.from()这个方法,这些变量就是初始值。)的Object、 
                    ------ delay:Number :开始动画之前的延时。这在实现多个动画时变得很有用。 
                    ------ ease:Function :You can specify a function to use for the easing with this variable. For example, gs.easing.Elastic.easeOut. The Default is Regular.easeOut. 
                    ------ easeParams:Array :An Array of extra parameter values to feed the easing equation. This can be useful when you use an equation like Elastic and want to control extra parameters like the amplitude and period. Most easing equations, however, don't require extra parameters so you won't need to pass in any easeParams. 
                    ------ autoAlpha:Number :Use it instead of the alpha property to gain the additional feature of toggling the visible property to false when alpha reaches 0. It will also toggle visible to true before the tween starts if the value of autoAlpha is greater than zero 
                    ------ visible:Boolean : 设置动画结束时物体的visible值。 
                    ------ volume:Boolean : 操控声音大小 
                    ------ tint:unit : 更改物体最终的hex颜色值,(如果用的是TweenMax.from()则是初始值。)tint的值应该像:0xFF0000 
                    ------ removeTint:Boolean : 当你想清楚设定的tint参数是,请将此设为true 
                    ------ frame:int :设置整个动画过程的帧数 
                    ------ bezier:Array :贝赛尔动画使你能够抛开线的束缚(意译)。举个例子,你可能想让一个DisplayObject的位置从原来的(0,0)移到(500,0),但是移动的时候想向下弯曲。只需添加你想要的object到贝赛尔array,每一个object代表一个"控制点"(控制点相关类容请参考Flash的 curveTO()这个画画的方法)在这个例子中,我们假定控制点坐标未(250,0)。只需要让你的my_mc的坐标为(0,0)。然后添加代码: TweenMax.to(my_mc, 3, {_x:500, _y:0, bezier:[{_x:250, _y:50}]}); 
                    ------ bezierThrough:Array : 和bezier同一原理,只是物体运动时会通过bezierThrough设定的点(物体不会通过bezier设定的点),这样就使控制更加直观。 
                    ------ orientToBezier:Array (or Boolean) :设计师/程序开发者一般想要的一个效果就是物体在运动的时候能自动调整自身的方向。(就使更改物体的旋转。)orientToBezier是这个变得很简单。为了准确地自动调整方向,TweenMax需要4条信息: 
                    -------- Position property 1 (即为"x") 
                    -------- Position property 2 (即为"y") 
                    -------- Rotational property (即为"rotation") 
                    -------- Number of degrees to add (可选 - 让你更好的控制你的物体) 
        orientToBezier这个属性应该是一个容器数组(Array),这个数组应包含至少一个子数组,而这个子数组则包含上述四个信息。为了最好的兼容性,你可以在这个容器数组里面输入任何数字,每一个都代表旋转属性。这在处理3D时十分便利。以为你可以在多重方向轴上旋转。如果你的项目是普通的2D (X/Y)贝赛尔运动,你可以只输入一个布尔值true,TweenMax就会自动创建一个数组[["x", "y", "rotation", 0]]。提示:不要忘记容器数组(就是一共有两层中括号[]) 
                    ------ hexColors:Object :尽管hex颜色是纯粹的数字。但你想使它们成为你的动画一部分(意译),你就会发现它们并不流畅地变化。为了让它们流畅地变化,红、绿、蓝通道必须分离,并单独的变化。在TweenMax里,这很简单。让你的物体从一种颜色变化到另一种颜色,运用hexColors属性就可以了。这个属性必须为一个 Object,Object的属性必须和你的物体的hex颜色的属性一致。举个例子:假如你的Object,my_obj有一个名为 "myHexColor"的属性,而你想在两秒内编程红色(0xFF0000),输入代码:TweenMax.to(my_obj, 2, {hexColors:{myHexColor:0xFF0000}}); 你可输入任何hexColor属性。 
                    ------ onStart:Function :如果你想在动画开始时调用一个函数,就在这里输入调用。如果动画开始前有延时,并且你想在那段时间弄点什么,这变得非常用。 
                    ------ onStartParams:Array :onStart调用的函数的参数 
                    ------ onStartListener:Function :一个TweenMax实例在动画开始时调用的函数。这就好比输入:TweenMax.to(my_obj, 2, {hexColors:{myHexColor:0xFF0000}}); 
                    ------ onUpdate : Function :如果你想在属性每次变化时调用一个函数(on every frame during the time the tween is active)就在这里输入一个函数调用。 
                    ------ onUpdateParams : Array :onUpdate调用的函数的参数(可选)。 
                    ------ onUpdateListener : Function :一个TweenMax实例在属性每次变化时调用的函数。这就好比输入:myTweenMaxInstance.addEventListener (TweenEvent.Update, myFunction); 
                    ------ onComplete : Function :动画结束时调用的函数。 
                    ------ onCompleteParams : Array :参考onUpdateParams : Array 
                    ------ onCompleteListener : Function :参考onUpdateListener : Function 
                    ------ persist : Boolean : 如果设置为true, TweenMax实例不会自动被垃圾回收。但即使设置为true,它仍然会被信的tween覆盖。默认为false 
                    ------ renderOnStart:Boolean :假如你用的是TweenMax.from(),并且在开始之前有延时,还有就是你希望在延时之后才开始渲染,就应设为true,默认为 false which causes TweenMax.from() to render its values immediately, even before the delay has expired. 
                    ------ overwrite : Boolean : If you do NOT want the tween to automatically overwrite any other tweens that are affecting the same target, make sure this value is false. 
                    ------ blurFilter : Object - To apply a BlurFilter, pass an object with one or more of the following properties: 
                             -------- blurX 
                             -------- blurY 
                             -------- quality 
                    ------ glowFilter : Object - To apply a GlowFilter, pass an object with one or more of the following properties: 
                             -------- alpha 
                             -------- blurX 
                             -------- blurY 
                             -------- color 
                             -------- strength 
                             -------- quality 
                             -------- inner 
                             -------- knockout 
                    ------ colorMatrixFilter : Object - To apply a ColorMatrixFilter, pass an object with one or more of the following 
                             -------- properties: 
                             -------- colorize 
                             -------- amount 
                             -------- contrast 
                             -------- brightness 
                             -------- saturation 
                             -------- hue 
                             -------- threshold 
                             -------- relative 
                             -------- matrix 
                    ------ dropShadowFilter : Object - To apply a DropShadowFilter, pass an object with one or more of the following -------- properties: 
                             -------- alpha 
                             -------- angle 
                             -------- blurX 
                             -------- blurY 
                             -------- color 
                             -------- distance 
                             -------- strength 
                             -------- quality 
                   ------ bevelFilter : Object - To apply a BevelFilter, pass an object with one or more of the following properties: 
                             -------- angle 
                             -------- blurX 
                             -------- blurY 
                             -------- distance 
                             -------- highlightAlpha 
                             -------- highlightColor 
                             -------- shadowAlpha 
                             -------- shadowColor 
                             -------- strength 
                             -------- quality

TweenMax.from(target:Object, duration:Number, variables:Object):TweenMax 
--描述: Exactly the same as TweenMax.to(), but instead of tweening the properties from where they're at currently to whatever you define, this tweens them the opposite way - from where you define TO where ever they are now (when the method is called). This is handy for when things are set up on the stage the way the should end up and you just want to tween them to where they are. 
--参数: Same as TweenMax.to(). (see above)

TweenMax.sequence(target:Object, tweenObjects:Array):Array 
--描述: 一系列的tween事件。Provides an easy way to sequence a set of tweens, one after the other. It's essentially the same thing as making a bunch of individual TweenMax.to() calls on the object with overwrite set to false, and the delays stacked. 
--参数: 
          ---- target : Object : The object whose properties to tween. 
          ---- tweenObjects : Array : An array of tween objects. IMPORTANT: each object must contain a "time" property defining the duration of that tween. Example: TweenMax.sequence(mc, [{time:1, x:"200"}, {time:2, autoAlpha:0, onComplete:myFunction}]);

TweenMax.multiSequence(target:Object, tweenObjects:Array):Array 
--描述: 和TweenMax.sequence(),不同在于能操控不同对象。Same as sequence() except it allows each tween in the sequence to have a different target. 
--参数: 
          ---- tweenObjects : Array - An array of tween objects. IMPORTANT: each object must contain a "time" property defining the duration of that tween AND a "target" property defining the Object that the tween pertains to. Example: TweenMax.multiSequence([{target:mc1, time:1, x:"200"}, {target:mc2, time:2, autoAlpha:0, onComplete:myFunction}]);

TweenMax.allTo(targets:Array, duration:Number, vars:Object):Array 
--描述: 同一变换应用到不同物体。Provides an easy way to tween multiple objects to the same values. It also accepts a few special properties, one of which is "delayIncrement" which staggers the start time of each tween. For example, you might want to have 5 MovieClips move down 100 pixels while fading out, and stagger the start times slightly by 0.2 seconds, you could do: TweenMax.allTo([mc1, mc2, mc3, mc4, mc5], 1, {y:"100", alpha:0, delayIncrement:0.2}); 
--参数: 
          ---- targets : Array - An array of objects to tween. 
          ---- duration : Number - Duration (in seconds) of the tween 
          ----vars : Object - An object containing the end values of all the properties you'd like to have tweened (or if you're using the TweenMax.allFrom() method, these variables would define the BEGINNING values). 
               -----Special Properties: 
                  ------- IMPORTANT: Accepts the exact same special properties as the to() and from() methods (see list above), and adds these: 
                  ------- delayIncrement : Number - delay (in seconds) between each tween's start time. This is useful for staggering the tweens. 
                  ------- onCompleteAll : Function - If you'd like to call a function when ALL of the tweens have finished, use this. 
                  ------- onCompleteAllParams : Array - An array of parameters to pass the onCompleteAll function

TweenMax.allFrom(targets:Array, duration:Number, vars:Object):Array 
--描述: Exactly the same as TweenMax.allTo(), but instead of tweening the properties from where they're at currently to whatever you define, this tweens them the opposite way - from where you define TO where ever they are. This is handy for when things are set up on the stage the way they should end up and you just want to tween them into place. 
--参数: Same as TweenMax.allTo(). (see above)

pause():void 
--描述: 暂停。Pauses the tween. When a tween is paused, it's "paused" property is set to true.

resume():void 
--描述: 恢复。Resumes a paused tween. When a tween is resumed, it's "paused" property is set to false.

addEventListener(type:String, listener:Function, useCapture:Boolean, priority:int, useWeakReference:Boolean):void 
--描述: 添加侦听器。Adds a TweenEvent listener.

removeEventListener(type:String, listener:Function):void 
--描述: 删除侦听器。Removes a TweenEvent listener. See the Flash documentation to learn about the removeEventListener() parameters.

TweenMax.getTweensOf(target:Object):Array 
--描述: 获得一个关于某对象的tweens的数组。Gets an array of all tweens affecting the target object. 
--参数: 
          ---- target : Object - The object whose tweens you want to get.

TweenMax.isTweening(target:Object):Boolean 
--描述: Checks to see if a particular object is currently being tweened (paused tweens don't count). 
--参数: 
          ---- target : Object - The object whose tweens you want to check.

TweenMax.getAllTweens():Array 
--描述: Returns an array of all tweens (including paused tweens).

TweenMax.delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array); 
--描述: 某一段时间后调用指定函数。Provides an easy way to call any function after a specified number of seconds. Any number of parameters can be passed to that function when it's called too. 
--参数: 
          ---- delay : Number - Number of seconds before the function should be called. 
          ---- onComplete : Function - The function to call 
          ---- onCompleteParams : Array - [optional] An array of parameters to pass the onComplete function when it's called.

TweenMax.killTweensOf(target:Object, complete:Boolean); 
--描述: 删除指定物体的tween。Provides an easy way to kill all tweens of a particular Object/MovieClip. You can optionally force it to immediately complete (which will also call the onComplete function if you defined one) 
--参数: 
          ---- target : Object - Any/All tweens of this Object will be killed. 
          ---- complete : Boolean - If true, the tweens for this object will immediately complete (go to the ending values and call the onComplete function if you defined one).

TweenMax.killDelayedCallsTo(function:Function); 
--描述: Provides an easy way to kill all delayed calls to a particular function (ones that were instantiated using the TweenMax.delayedCall() method). 
--参数: 
          ---- function : Function - Any/All delayed calls to this function will be killed.

TweenMax.killAllTweens(complete:Boolean):void 
--描述: Kills ALL tweens (but not delayedCalls). 
--参数: 
          ---- complete: Boolean - If you'd like to force the tweens to complete, set this to true. (it's false by default)

TweenMax.killAllDelayedCalls(complete:Boolean):void 
--描述: Kills ALL delayedCalls. 
--参数: 
          ---- complete: Boolean - If you'd like to force the delayedCall to complete, set this to true. (it's false by default)

TweenMax.pauseAll(tweens:Boolean, delayedCalls:Boolean):void 
--描述: Provides a way to pause all TweenMax tweens and/or delayedCalls (not TweenLite/TweenFilterLite tweens or delayedCalls). 
--参数: 
          ---- tweens: To pause tweens, set this to true. (it is true by default) 
          ---- delayedCalls: To pause delayedCalls, set this to true. (it is false by default)

TweenMax.resumeAll(tweens:Boolean, delayedCalls:Boolean):void 
--描述: Resumes all TweenMax tweens 
--参数: 
          ---- tweens: To resume tweens, set this to true. (it is true by default) 
          ---- delayedCalls: To resume delayedCalls, set this to true. (it is false by default)

TweenMax.removeTween(tween:TweenLite):void 
--描述: Kills a single tween instance. 
--参数: 
          ---- tween: The TweenMax/TweenFilterLite/TweenLite instance that you'd like to kill.

TweenMax介绍相关推荐

  1. TweenMax动画库学习(三)

    目录               TweenMax动画库学习(一)            TweenMax动画库学习(二)            TweenMax动画库学习(三)           ...

  2. flash TweenMax用法

    二,TweenMax主类: 这里分几个大块来介绍,分别是:第三个参数特有属性(29个),PlugIn(17个),公共属性(10个),公共方法(20个). 1,第三个参数特有属性(29个): 这29个参 ...

  3. (转)TweenMax动画库学习(四)

    上一节我们主要聊了TweenMax动画库中的seek()完成指定的动画(无过渡).time() 动画已执行的时间.clear():清除所有动画等方法的使用,接下来我们继续学习TweenMax动画库中的 ...

  4. AS3.0常用第三方类库:TweenMax

    一,主要代码结构: com.greensock包里面,首先最主要的就是TweenMax.as:然后一个常用的是 com.greensock.easing.*;里面包含了15个缓动,下文再一一介绍:另外 ...

  5. tweenMax学习笔记

    tweenMax是一款缓动插件,能实现很多牛逼的效果,在网上看了些demo,确实很吊,虽说很多用CSS3也能做出来,但是技多不压身,学之. 网上的demo还是很多的,但是资料不多,唯一能够让我有思绪的 ...

  6. 2.GSAP(TweenMax手册/TweenLite手册)之一

    GSAP(TweenMax手册/TweenLite手册)之一 本文章内容是关于GSAP动画库中的TweenMax和TweenLite的使用,编写于2020年10月22日00时47分(v1.0.0). ...

  7. TweenMax.js

    TweenMax.js TweenMax是GreenSock Animation Platform(GSAP)动画平台核心文件,TweenMax中文网提供TweenMax插件下载,以及TweenMax ...

  8. TweenMax.to()的使用

    简单介绍 TweenLite/TweenMax是GreenSock 动画平台中的核心动画工具,可用来构建补间动画(tween),实现组件的移动 官网地址 CDN ​ 在本人室内定位项目前端演示中,需要 ...

  9. Vue详细介绍及使用(组件)

    Vue详细介绍及使用 一.Vue组件概念 1.基本的概念 为什么需要组件化?在实际开发中,我们经常也会封装很多公共方法,达到复用的目的,也便于维护.对于前端也是一样,那么什么是组件?     官方定义 ...

最新文章

  1. 文件到Java中的byte []
  2. php整蛊关机代码,整人代码大全
  3. python打开文件_喜大普奔 | 如何在Win10下利用Python打开grib文件
  4. 压力与动力是否成正比?
  5. CodeForces512C-Pluses everywhere-模拟/数学/排列组合模板
  6. MYSQL重置密码遇到ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using passwor:yes)问题
  7. 有道翻译js解密(1)
  8. 【Todo】【转载】Scala中Array, List, Tuple的区别
  9. InfluxDB学习之InfluxDB常用函数(三)变换类函数
  10. avrdude: stk500_getsync(): not in sync: resp=0x00
  11. 百度竞价恶意点击真的存在吗?
  12. chm文档打开后提示已取消网页导航
  13. [E::hts_idx_push] NO_COOR reads not in a single block at the end 10 -1
  14. Sci-Hub创始人收到苹果的通知:2年前就把她的账户数据给了FBI
  15. 微信怎样收发邮件,一款更全能的掌上邮箱,随心邮你
  16. canvas在PC端实现振幅大小可变的动态波浪图
  17. Nginx 最实用的配置技巧!速看
  18. websocket封装,有心跳和断开重联功能
  19. 在studio one中使用iZotope Ozone 9?臭氧9怎么导入到Logic Pro X和AU中?速看教程
  20. 芋道 Spring Boot API 接口文档 Swagger 入门

热门文章

  1. Panoramic Imaging及其应用于场景理解的综述
  2. 云消防大数据_2020年刚需系列专题之智慧消防大数据平台建设方案 智慧消防云平台项目 解决方案,一查就有...
  3. 2022-2027年中国发动机仪表市场规模现状及投资规划建议报告
  4. ORAN C平面 Section Extension 10
  5. 大数据为我们的生活带来了什么?
  6. r语言中残差与回归值的残差图_独家 | 手把手教你用R语言做回归后的残差分析(附代码)-阿里云开发者社区...
  7. 群星灵能界所有事件_张丹峰出轨经纪人实锤!愿所有原配都能活得像小三一样...
  8. c++写一个函数验证哥德巴赫猜想
  9. 为NanoPi M2 自制Debian镜像
  10. 一秒快速修正 mysql ERROR 1406 (22001): Data too long for column ‘name‘ at row 1