2005-4
18
在gotoAndPlay和一帮老外深入讨论了以下swf的动画效率、编译体积问题。
swf的关键帧+渐变机制,想必给大多数设计者带来了很大的方便。然而你有没有发现,有时候仅仅是简单的Symbol和Keyframe,swf文件还是特别大。
对,问题就出在渐变。Macromedia对渐变、Keyframe的优化仅仅存在IDE中。
你可以做一个实验,试一下就知道了,swf编译之后对Motion中的每一帧都视为Keyframe。
那么是否要用tween来实现呢。
randall的观点是没有必要,再者tween由于集成了太多的功能,显得文件冗成复杂。倒不如自己写一个class。不过对于我这种代码写的比较慢时间又不多的人,还是用tween吧,也就2k:)
(当然tween在旋转方面的缺陷只能尽量避免了)
下面的数据是Chekote的出的结论。
$[$font=宋体$]$$[$size=2$]$————————————————————————
Test 1: 250Frames/10secs |Test 2: 1000Frames/40secs |Conclusion |
————————————————————————
Version 1 |Version 1 |Version 1 |
————————–|————————–|—————–|
KeyFrame @ Frame 1 |KeyFrame @ Frame 1 |400% timeline |
KeyFrame @ Frame 250 |KeyFrame @ Frame 1000 |length results in|
No Tween |No Tween |110% swf size. |
Size: 97bytes |Size: 107bytes | |
| | |
————————–|————————–|—————–|
Version 2 |Version 2 |Version 2 |
————————–|————————–|—————–|
KeyFrame @ Frame 1 |KeyFrame @ Frame 1 |400% timeline |
KeyFrame @ Frame 250 |KeyFrame @ Frame 1000 |length results in|
TimeLine Tween |TimeLine Tween |341% swf size. |
Size: 819 bytes |Size: 2,792 bytes | |
| |ouch! |
————————–|————————–|—————–|
Version 3 |Version 3 |Version 3 |
————————–|————————–|—————–|
Single Frame |Single Frame |400% timescale |
onEnterFrame _x increment |onEnterFrame _x increment |results in 104% |
Size: 187 bytes |Size: 194 bytes |swf size. |
| | |
————————–|————————–|—————–|
Version 4 |Version 4 |Version 4 |
————————–|————————–|—————–|
Single Frame |Single Frame |400% timescale |
mx Tween Class |mx Tween Class |results in 100% |
Size: 2,282 bytes |Size: 2,282 bytes |swf size |
| | |
————————–|————————–|—————–| $[$/size$]$$[$/font$]$
Test 1: 250Frames/10secs |Test 2: 1000Frames/40secs |Conclusion |
————————————————————————
Version 1 |Version 1 |Version 1 |
————————–|————————–|—————–|
KeyFrame @ Frame 1 |KeyFrame @ Frame 1 |400% timeline |
KeyFrame @ Frame 250 |KeyFrame @ Frame 1000 |length results in|
No Tween |No Tween |110% swf size. |
Size: 97bytes |Size: 107bytes | |
| | |
————————–|————————–|—————–|
Version 2 |Version 2 |Version 2 |
————————–|————————–|—————–|
KeyFrame @ Frame 1 |KeyFrame @ Frame 1 |400% timeline |
KeyFrame @ Frame 250 |KeyFrame @ Frame 1000 |length results in|
TimeLine Tween |TimeLine Tween |341% swf size. |
Size: 819 bytes |Size: 2,792 bytes | |
| |ouch! |
————————–|————————–|—————–|
Version 3 |Version 3 |Version 3 |
————————–|————————–|—————–|
Single Frame |Single Frame |400% timescale |
onEnterFrame _x increment |onEnterFrame _x increment |results in 104% |
Size: 187 bytes |Size: 194 bytes |swf size. |
| | |
————————–|————————–|—————–|
Version 4 |Version 4 |Version 4 |
————————–|————————–|—————–|
Single Frame |Single Frame |400% timescale |
mx Tween Class |mx Tween Class |results in 100% |
Size: 2,282 bytes |Size: 2,282 bytes |swf size |
| | |
————————–|————————–|—————–| $[$/size$]$$[$/font$]$
可见,swf的渲染机制两个要素:
·每一个keyframe和motion只是在fla中优化,在swf中,不是Frame便是Keyframe。要么就是BlankFrame。没有所谓的MotionFrame。
·每一个frame和as都被编译为bytecode(字节码)没有必要过分追求IDE之内的效率和美观
PS:不要太在意你的IDE,更多的关注swf的效率和体积,才是一个设计师的素质:)
本文来自:http://www.awflasher.com/blog/archives/192
还没找到您要的东西?Google试试看吧,
Google更注重原创、时效性好的文章:
Google更注重原创、时效性好的文章:
| 相关阅读 | 本月十大 |




你好,又在Google上搜索到了你的网页。
我很想和你探讨一下,SWF文件中关键帧的判别问题。
SWF文件中motion的一个最大的特点就是一个PlaceObject2标签ShowFrame然后再一个
PlaceObject2,ShowFrame。通过程序可以简单地判断出来。但是应该也不会太精确。
希望能收到你的E-Mail。
你好,不小心进了你的博客,看到你这样的人才,真是难得,还看到了你身体最近好像不太好,先祝你早日康复,事业步步高升!同时偶也带来了个问题想请教一下。谢谢指点!
问题:在FLASH舞台上画一个文本框,然后运行,再用鼠标将某个文件拖放到舞台上,能不能将这个文件的路径写在文本框中?我只是猜想,不知FLASH能不能实现!
谢谢指点。
这个问题需要借助VC来解决。
文件drop到VC的区域(VC实现要与Flash“沟通确定”区域的位置参数)
谢谢三楼,通过你的指点我找到了解决问题的方法
若有同要问题的朋友请参考:http://topic.csdn.net/t/20020428/08/683205.html#