PDA

View Full Version : Componets won't export on frame 2


gaby
08-26-2007, 04:13 PM
(apologies for mis-spelled title, I can't edit it after publishing...)

I'm having a frustrating problem trying to get my preloader to load promptly and have my components work with their AS classes exporting on frame 2. I previously had everything working by exporting it all on frame 1, so my preloader only kicked at around 95% loading. Having read the many, many tutorials about this problem the solution they offer is:

1. Turn off 'Export on first frame' in *all* movie clips, and in the Linkage settings of all the components.
2. Drop a copy of each symbol/component I want exported somewhere on the stage, not on frame 1
3. Change the AS export settings to export classes on frame 2

I opted for a slightly different approach, I put all my exported symbols in a separate scene, which is visited after the preloader is done. All my code works fine, all the components that are used are b0rked.

This is what it should look like, (http://vanhegan.net/pictures/ons2-notbroken.png) with all the classes exported on the first frame.

This is what it looks like (http://vanhegan.net/pictures/ons2-broken1.png) when the classes are exported on frame 2.

Strangely this is what it looks like (http://vanhegan.net/pictures/ons2-broken2.png) when I then re-export the SWF in MTASC (classes into frame 2), it sort of comes back to life a bit.

Clearly something is amiss here. Either I'm doing something wrong or some code somewhere is broken. Has anybody else beaten this problem? Google only turns up hundreds of tutorials about how to not export everything on the first frame, nothing that actually addresses this problem.

Gaby

atomic
08-26-2007, 05:02 PM
Senocular provides a good explanation here...

http://www.senocular.com/flash/tutorials/faq/#preloaderstart

But as he himself suggest at the end... An alternative is to not uncheck anything and/or change the export frame, and to use a new separate preloader only movie, to load your movie cleared of it's present preloader...

Alternatively, to bypass all of the above complications, you can just use a separate swf that consists only of a preloader to load your main movie into a new level of that preloader swf. This will also make it easy to use the same preloader swf to load multiple other swfs.

If you PM me a request and an address, I could mail you such a seperate preloader only .fla.

gaby
08-26-2007, 05:38 PM
Putting everything into separate clips may solve the problem but I am restricted to using one .swf file for the whole project. I have a preloader running on it already that never leaves frame 1 of the first scene until the whole clip is loaded. I have also made sure there are no references to anything that involves a class until at least frame 2, where all the classes should be exported to. The bandwidth profiler confirms that frame 2 is where the bulk of the data lies.

The curious part is that all my clips (every single one is controlled by an AS2.0 class) all work fine. All the sounds are exported and work fine too. The only things that are broken are all the MM components. Could it be that my pre-load frame with all the symbols in it resides in a different scene? I'm going to try moving that to the preloader scene and see if it makes a difference.

Gaby

gaby
08-27-2007, 12:11 PM
Stranger behaviour still, if I 'Test Movie' the .swf in Flash and stream it at 10k/sec, the components work half work (working but not styled) but lumps of my code does not. If I just test the movie and let it load at native speed, my code works but the components do not.

Meh?

gaby
08-29-2007, 12:17 PM
Problem solved: reboot the computer. I was having weird flash issues in general so a quick reboot and the problem is completely gone away. I now have 7k on the first frame and 370k on the rest, the preloader kicks in immediately and all the components render perfectly.

Crisis averted!

Gaby

Buya
09-11-2007, 05:53 PM
If you PM me a request and an address, I could mail you such a seperate preloader only .fla.

Sorry to butt-in on this thread but thanks for sending me the code. I am fairly new to Flash and I have been looking for a way to accomplish this. I have seen numerous website use a "shell" to load external .swf files and this method works great. The code is well commented so even I could understand.

Thanks atomic ;-)

atomic
09-11-2007, 06:02 PM
;)