PDA

View Full Version : Moxie makes large files


sys2074
08-08-2007, 07:12 AM
Ok, this is about Flex 3 but since there is no forum for this yet...

If I create a basic ActionScript (non-using MXML/Flex Framework) SWF with Flex 3 it is around 130Kb large. I suppose Flex 3 puts several default classes into the SWF. Is there any way to turn this off so I get tiny SWF's like with Flash?

jsimpson
08-08-2007, 03:08 PM
I was under the impression that one benefit of flex 3 was that the flex framework was cached so that although the files are large with few items it in a end user would only download a small portion of that information once they've viewed someones flex program.

http://www.onflex.org/ted/2007/06/flex-3-thursday-dramatically-smaller.php

I'm not sure if that information or the other stories I've heard are real or not. But flex does have a much larger footprint that can't be removed compaired to flash.

sys2074
08-08-2007, 03:23 PM
I think the caching thing is yet another story but has nothing to do with this.
However if you say that Flex always creates a 'base' SWF of 130Kb then it is pretty useless for creating lightweight Flash movies with the Flex compiler. So I though that there might be a way (compiler argument?) to prevent Flex from packing default stuff into the SWF?!?

sys2074
08-08-2007, 03:31 PM
Ok I've found that it definitely is not the compiler nor Moxie. I've created some custom AS3 preload handling classes, these include two classes and one is used as a factory class so I use ...

[Frame(factoryClass="examples.preloader.CustomPreloader")]
public class PreloaderExample extends Sprite {
...


... in the main class to make the Preloader class the root class.
This has nothing to do with Flex's own preloader but still the SWF is 132Kb large just from this! Hmm, this pretty much ridicules the use of these Preloader classes lol!

sys2074
08-08-2007, 03:40 PM
Holy sh*t Robin! Ok to confirm this ... as soon as you use something like ...

[Frame(factoryClass="examples.preloader.CustomPreloader")]

before your class to make the Preloader class the root, the SWF becomes 130Kb right without adding ANY other classes. I don't know what kind of Rat-tail Flex adds to the SWF but how the heck are we supposed to ever create a working preloader for an AS-only based project that is being compiled with mxmlc?!?