zz from:http://www.psyked.co.uk/adobe/flash/stop-using-mxtransitionstween.htm
If you’re still using Flash’s inbuilt Tween
classes for you scripted animations, I suggest you stop - and start making things easier for yourself by using Tweener
instead.
Tweener is a class that replaces Tween, works for Actionscript 2 and
Actionscript 3, offers a simpler interface for creating tweens, and has
a larger range of easing options to work with.
What’s wrong with Tween?
The Tween class is ok - up to a point. It does what it’s supposed
to, but once you start trying to integrate it with serious full-on
Actionscripting you’ll notice a few snags. If you’re dynamically
creating and removing objects, and then want to dynamically modify the
tweens, your tweens will likely go crazy. Start a new Tween and there’s
very little way you can stop it - even by removing its subject.
Stacking Tweens doesn’t go down well either - if you create one to move
an object left to right, and then mid-animation another to move it back
to the left, things go ok until the point that the first animation
should finish - whereupon your object will flick back to the finishing
position of the first, and then resume the second animation.
Moreso than that however, is the hassle needed to create an animation with Tween;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var xPosT:Tween = new Tween(myMovieClip, "_x", Bounce.easeOut, 0,
Stage.width, 3, true);
xPosT.onMotionFinished = function() {
// movement finished
};
Why is Tweener better?
First up, there’s no problems with mixing and matching, no misplaced
motion crazyness. You can apply and reapply tweens to your hearts
content, and they all work.
Secondly, the interface is simpler - you can setup a tween with less
lines of code, and you don’t have to worry about managing objects to
execute functions once your tween has run its course. And a single line
of code can handle all of the attributes you want changing for a single
object - no separate Tween objects for each attribute, just a single
Tweener line for all the attributes (on the same object, under the same
time and easing style).
import caurina.transitions.Tweener;
Tweener.addTween(myMovieClip, {_x:Stage.width, time:1, transition:"linear",
onComplete:onCompleteHandler});
function onCompleteHander():Void {
// movement finished
};
Thirdly, you don’t have to worry about things like start variables -
just the end variables. Which makes far more sense. In most
situations I find I’m only adding the current position of an object as
the start variable to Tween. In Tweener, that’s taken as the automatic
variable - after all, if you want to set a different position for the
object before the tween starts, you just do that on the line above.
Lastly, there’s a invaluable delay
attribute. It’s
a built-in timer for your animations - how useful is that! Want an
animation to start after 10 seconds? Easy - just add ‘delay:10′ to your
Tweener line.
分享到:
相关推荐
fl.transitions,包
CSS Animations and Transitions for the Modern Web shows designers how to add movement to web pages over time using CSS3 style definitions. Author Steven Bradley begins as simply as possible and uses...
Overall, your organization will interact with constituents more effectively and handle staff growth and transitions by tracking all contacts and interactions with them in a system shared across the ...
Overall, your organization will interact with constituents more effectively and handle staff growth and transitions by tracking all contacts and interactions with them in a system shared across the ...
as3的缓动效果 包含tweenlite tweenmax timerlite swc 另外包含效果的示例使你的制作效果更丰富
里面有Api 最好用的flash缓动包.
这个引擎的主类是 caurina.transitions.Tweener。 Tweener的语法很容易适应。与Adobe的Tween类不同,你不需要实例化主类Tweener。而是调用Tweener的静态方法。主要的方法是addTween。就像这样: Tweener.addTween...
需要突出显示两个图像之间的差异吗?TwentyTwenty,jQuery视差插件,可以轻松地找到他们 !
在原本需要使用android.transition.*的地方使用android.transitions.everywhere.*。如果你想在xml文件中使用transition,不要将xml放在res/anim,而是放在res/transition目录。同时你需要使用将命名空间改为app 而...
CSS transforms, CSS transitions, and CSS animations are three separate CSS specifi‐ cations. While the three terms sound like they may do the same thing—make some‐ thing move—CSS transitions and ...
非常不错的书 Preface . . . . . . . . ....Who Should Read This Book ....Conventions Used ....Code Samples ....Tips, Notes, and Warnings ....Supplementary Materials .... ....Chapter 1 Falling In Love With AngularJS ....
timage transitions for your example and use. quite useful
html5图片切换jquery css3 Transitions...
用了一个fl.transitions.Fade效果 我觉得还不错
包括缓动效果的所有类文件 (caurina.transitions.*)
2.4.3 Using VSB Projects to Create VxWorks Systems: Basic Steps .................... 21 2.4.4 Developing Kernel Applications for VSB Systems ..................................... 21 2.5 VxWorks ...
// Use **transitions.loadScene** instead of **cc.director.loadScene** // cc.director.loadScene(url, this.onLoadSceneFinish.bind(this)); this . transitions . loadScene ( url , 'Canvas/Main Camera' , '...
单工呼叫系统是我根据以前学长写的代码仿制的,对嵌入式的学习将会有更深层的理解、、
Article about Support Library for Transitions. Overview and comparison with Transitions-Everywhere Simple example TransitionManager.beginDelayedTransition(transitionsContainer); text.setVisibility...