How to preload in Flash MX 2004 & Kill Yer Calender

In Flash MX, Export in First frame was introduced. This would then end up giving your SWF file a ton of k in the first frame, therefore, the user wouldn’t see anything for a long time before your SWF was finally downloaded from the web.

In MX, you solved this in 3 ways:
– make a new SWF to load the big one (this didn’t always work because some components didn’t work correctly when loaded into a level)
– use shared libaries via making a new SWF (worked well in later versions of the Flash 6 player, but still required another SWF)
– OR: uncheck all components “Export in First Frame”, frame 1 = lightweight preloader, frame 2 = all your components off stage, frame 3 = your app

In 2004, even if you uncheck export in first frame on even just one component, you’ll still have about 32k in the first frame. I thought my days of single SWF delivery were over when I heard this. Thanks to -insert tomorrow-, there is a new feature that I came across, but didn’t know the significance at the time… until now.

The reason for the 32k is that all class files are compiled on frame 1. To get around this, you can use the class frame feature under File > Publish Settings, Flash Tab, and then the “Settings…” button next to the ActionScript version field. This allows you to set the frame to export you classes on. Set it to frame 2, and you can use the 3rd option above (uncheck all first frame export, frame 1 preloader, frame 2 components, frame 3 app).

… I was so skeered, but now I’m happy as hell!


BTW, if you see I took out my stoopid calendar and replaced it with a Flash widget. It’s my first app in Flash 7. Basically, I needed to learn Pro, so I dove straight in trying to use the components. I used the Accordion pane that comes standard, and populate it with people’s blogs. Now, I’m not playing favorites, it’s just I used the same XML parsing for RSS v0.91 or whatever, so those 4 were the only ones that worked, hehe. I tried using the XMLConnector, but couldn’t figure out how to attach variables to it to send to PHP (that’s how I get around the security sandbox). Anyway, I know it needs some work (titles?) so I’ll post the source tomorrow morning.