Copy link to clipboard
Copied
Hi.
I've been converting an animation previously compiled with ActionScript 1 to ActionScript 3. Not a huge difference, but AS3 has a few bonus features.
In this day of ultra-fast broadband file size is not much of an issue for most, however I acquired the habit of shrinking everything as much as possible back in the bad old days, and find the habit hard to break.
AS1 file = 57 kb
AS3 file = 63 kb
Notably AS3 exports AS3 classes (in bytes):
11401 Scene 1 (AS 3.0 Classes Export Frame)
compared with (in bytes):
2771 Scene 1 (AS 1.0 Classes Export Frame)
Font subset embedding has gotten more expensive overhead-wise as well:
Verdana = 8244
Tekton Bold = 4472
OCR A Extended = 3800
compared with:
Verdana = 6297
Tekton Bold = 2493
OCR A Extended = 2505
Movie A is Flash 9 compatible and Movie B is Flash 8. Why are fonts bigger in Flash 9? Has anyone else noticed this? I made the Flash 8 movie on Windows Vista originally, and the Flash 9 version on Windows 10, where fonts are larger. Could that account for it? I generated the size reports in Windows 10 for both.
Also, can AS3 classes be optimized?
Thanks.
Tom
you manually control classes by using class files. start with the document class.
Copy link to clipboard
Copied
actionscript 3 was designed to be faster, not smaller. for smaller file size you would need to use fewer classes.
font sizes wouldn't change because of flash/animate. they would change based on the os font size and the characters being embedded.
Copy link to clipboard
Copied
Thank you for the answer.
I haven't tried Animate, though I suspect font sizes are closer to those in Flash 9. If the size reports are true, embedded fonts are smaller in Flash 8 than in Flash 9. Fonts in Flash 9 seem to have more data. Some fonts are bigger in newer Operating Systems, because they contain more character subsets. The fonts embedded in Flash are limited to the characters in the movie. "Hello World!" is HWdelor!. There shouldn't really be any increase in the size.
As far as optimizing ActionScript 3 goes, I was thinking that there might an option to override classes that are imported by default; you could manually import classes as needed like in Java, but I don't believe there is that option.
Classes designed for speed may or they may not compensate for the larger file size. I'm pretty neutral on the issue. I haven't noticed that the AS3 movie takes longer to load than the AS1 movie, and I'm sure speed is generally an improvement.
Copy link to clipboard
Copied
you manually control classes by using class files. start with the document class.
Copy link to clipboard
Copied
By manually importing classes, say in the first frame, is it possible to shrink the overhead?
Admittedly, I know little of the approach. Working with a Flash movie, I'd prefer to determine which classes have been imported and are needed as opposed to classes that may be non-essential, if such exist, and try to eliminate those.
Anyway, the answer is correct. "Manually control classes". I wasn't aware that could be done.
Thank you.
Copy link to clipboard
Copied
if you put code in the first frame you'll increase your swf file more than necessary.
again, use the document class and put no code on a timeline if you want to minimize swf size. you can use the sprite class instead of the movieclip class to further reduce file size..
Copy link to clipboard
Copied
Your suggestion makes sense. The library has about fifteen movieclips, and except for a preload segment (four frames), no timelines.
What I'm just a bit skeptical about, since I'm away from my computer for a few days, is the notion that vector graphics as movieclips could be further optimized by converting the objects to sprites. I thought most of the overhead from vectors came from the number of nodes and Bezier curves.
It will be interesting to see how much the shrinkage is.
Copy link to clipboard
Copied
i don't think it would be worthwhile to change all your movieclips to sprites unless the file size is breaking something (eg, max file size for an ad.)
Copy link to clipboard
Copied
No, but if you want to lose weight, why not lose all of it? I have to see what will work. It's hard to comment otherwise. Getting rid of excess classes should be my first priority. At the very least I will learn how it's done. I may also find that the movie is optimized and manually importing classes will only marginally shrink the size.
Still, worth giving it a whirl. Thanks.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now