<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="css/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>class rkuk implements ActionScript-TweenLite源码剖析3</title><link>http://www.rkuk.org/post/18.html</link><generator>RainbowSoft Studio Z-Blog 1.8 Arwen Build 90619</generator><language>zh-CN</language><pubDate>Sat, 28 Nov 2009 23:22:46 +0800</pubDate><item><title>Re:TweenLite源码剖析3</title><author> (gerr87)</author><link>http://www.rkuk.org/post/18.html#cmt73</link><pubDate>Fri, 29 Jan 2010 12:00:28 +0800</pubDate><guid>http://www.rkuk.org/post/18.html#cmt73</guid><description><![CDATA[如果就实用性来说，显然应该选择tweenlite，tweenmax代码简洁，代价不小]]></description></item><item><title>Re:TweenLite源码剖析3</title><author>flast365@163.com (zszen)</author><link>http://www.rkuk.org/post/18.html#cmt19</link><pubDate>Mon, 07 Dec 2009 01:02:20 +0800</pubDate><guid>http://www.rkuk.org/post/18.html#cmt19</guid><description><![CDATA[谢谢 , 其实我并不像让两次设置的属性都完全进行完毕, 我只希望出现overwrite=2/tweenmax这样的功能, 不过尝试了,还是max好用.]]></description></item><item><title>Re:TweenLite源码剖析3</title><author> (zszen)</author><link>http://www.rkuk.org/post/18.html#cmt17</link><pubDate>Fri, 04 Dec 2009 18:42:55 +0800</pubDate><guid>http://www.rkuk.org/post/18.html#cmt17</guid><description><![CDATA[这样做显然太麻烦, 发现timelite的overwrite设置为0可以实现效果,但是可能会出现混乱(前后有同样属性设置的时候), 但是用tweenmax就不存在这种情况 ,也不需要设置什么overwrite, 但总会给我耗费资源的感觉 哈<blockquote><div class="quote quote3"><div class="quote-title">rkuk 于 2009-12-4 19:37:46 回复</div>当使用TweenMax的时候，TweenMax有个静态属性_overwriteMode的初始化会启动OverwriteManager把所有新建的Tween的overwrite模式都设置为2，这与引入TimelineLite的效果是一样的，所以可以解决覆盖冲突的问题。<br/>设置overwrite=0就是取消检测操作同一个对象的Tween之间的冲突，这样可以让后创建的Tween不覆盖已有的Tween，但此时如果后创建的Tween操作的属性和先创建的Tween操作的属性有冲突时，后创建的Tween对这个属性的操作是不起作用的。文章里面说过后创建的Tween会先被渲染，而起作用的是最后渲染的Tween。<br/>因为看到你好像是需要创建有先后顺序的的Tween，所以想到用TimelineLite。我觉得引入TweenMax只能解决你说的冲突问题，但是并不能解决先后问题，当然你可以使用delay属性来创建时序。如果你实在不想用TimelineLite，而只用delay的话，那么用TweenLite也可以设置delay，此时可以用OverwriteManager.init将overwrite设为0或者2，都可以解决冲突。<br/>再补充一点：TweenMax在初始化的时候会自动注册很多plugin，并且TweenMax的renderTime方法要比TweenLite复杂，这个方法会被反复调用所以会比较影响效率。相对而言TimelineLite的渲染就快速一些，而且不会注册plugin，又方便时序管理。我想并不是代码看起来多就浪费，敏捷开发的一个观点就是清晰易看懂的代码会让你的效率更高！</div></blockquote>]]></description></item><item><title>Re:TweenLite源码剖析3</title><author> (zszen)</author><link>http://www.rkuk.org/post/18.html#cmt15</link><pubDate>Thu, 03 Dec 2009 02:52:42 +0800</pubDate><guid>http://www.rkuk.org/post/18.html#cmt15</guid><description><![CDATA[请问当我对一个sprite设置了alpha淡入进来, 还没有完全完成, 就激活了x/y位置属性或是scale属性 ,默认情况下alpha动作就会消失 , overwrite也无法改正效果, 我的方法只有在新的动作里面也加入alpha淡入, 才能避免, 但是我认为, 这样做可能会很浪费, 而且逻辑可能会很混乱<blockquote><div class="quote quote3"><div class="quote-title">rkuk 于 2009-12-3 12:09:53 回复</div>我想alpha动作之所以消失是因为后创建的x、y的tween的overwrite=1，所以覆盖了alpha的tween。看来你需要先完成alpha后再开始位置或大小的tween，像这样带有“顺序”的tween可以装入一个TimelineLite中以便于控制，并且引入TimelineLite会自动把所有新创建的tween的overwrite模式都设置为2，这样就可以避免以外的覆盖。可以这样做：<br/>var tl:TimelineLite = new TimelineLite();<br/>var alphaTween:TweenLite = TweenLite.from(sp,5,{alpha:0});<br/>var posTween:TweenLite = TweenLite.to(sp,5,{x:100,y:100});<br/>tl.append(alphaTween);<br/>tl.append(posTween);<br/></div></blockquote><br/>由 rkuk 于 2009-12-3 12:24:16 最后编辑]]></description></item></channel></rss>
