Flash app depends on Flex. Are there any SWF bytecode size optimizers?

痞子三分冷 提交于 2019-12-23 16:03:50

问题


Hello world application that uses Flex, compiled with optimize=true has size 178K. How to reduce application size?

We do not like to use RSL, we don't like to avoid Flex.

Largest part of resulting SWF is unused bytecode. Are there any tools to optimize bytecode — drop unused methods, classes, give methods shorter names and so on?

I know some such tools for Java bytecode. Any there any for SWF?


回答1:


The size is the cost of the Flex API. You don't get to pick and choose which parts are compiled in, so the best case is going to still carry a lot of baggage.

If size is a big worry, you can get away with using only the flash side of ActionScript, but you lose out on a lot of the nice prebuilt Flex components.




回答2:


You could try some Flash Optimizer on it, but I doubt things will get much better. Isn't it possible for you to change the source code, do the optimizations you mentioned and recompile the application?

Or are you talking about Flex overhead? If so, you shouldn't care, as for bigger projects this will stay almost the same, and if it grows, it's because of some classes or methods you need (Multimedia etc.).




回答3:


Why not RSL? Keeping the flex framework separate as an RSL seems the only option worth considering in your case. The RSL gets cached between requests.

The optimizers won't dramatically reduce the size if it's already as low as 178k. Also, looking at that size, I presume you are not embedding any images or other resources. If you are, taking them out and loading them dynamically will help too, but at the cost of making more HTTP requests.




回答4:


Well - is this a case of choosing the right tool? If you need to create an application - I wouldn't think the overhead to be too detrimental. If you are creating a website, I can see where you might want a smaller filesize - you might need to use pure actionscript without the overhead of the flex framework.

You did say that you didn't want to avoid flex - do you mean flex builder or the flex framework? You can still use flex builder to create actionscript only projects and it's a dream compared to the actions panel in CS4...




回答5:


try this link about flex file size optimization.
http://askmeflash.com/article_m.php?p=article&id=9

These are the major improvements that can be done.All applications created in Flex run on Flex framework so the basic framework has to be there. For example , if you are using a container then Classes like Event manager, Stylesheet manager, Stage, Application, are a must which make initial size of flex application and cant be avoided. The other alternative is using flash only.




回答6:


You want to use Flex AND you want your project to be small. But Flex is large.

It sounds like you must make a decision.



来源:https://stackoverflow.com/questions/634293/flash-app-depends-on-flex-are-there-any-swf-bytecode-size-optimizers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!