MX 2004 uses a new component architecture,
with a lot of classes being included right from the 1st usage on,
which adds about 30k to the 1st frame even if you uncheck “export in 1st frame” on all of them.
There’s been a few questions on how to best preload mx2004 swf’s, so here’s what you need to read to solve all your troubles:
Hey cmplx … I had the same thing happen. You can’t export to a frame further down, coz if you’re using the preloader component, you need to export it at frame one!!!
Even setting it manually thru the linkage doesn’t help. So, unless you’re making your own preloader (ie not using the component progress bar) this information is good.
However, if you WANT to use the progress bar … good luck in getting it to work the way it should!
Let me know if you manage to work around this error.
I like to work as much as possible with code inside .as files instead of building the GUI on the stage (reusability reasons, etc.).
Can anyone make this?
A .fla file with preloader (ProgressBar) and then (at a later frame) instantiate a class that makes a plain window in it’s constructor)
An .as file containing that simple class.
I did this:
.fla with 3 frames
1st frame - ProgressBar with “Export in first frame” checked
2nd frame - set this as "Export frame for classes"
3rd frame - instantiate the class
I should add, that window was dragged to the stage and deleted and “Export in first frame” option was unchecked.
I’ve made some variations (even let the window on stage at the 2nd frame) but the results were pretty much as follows:
When simulating bandwidth it was working almost in every case
When played directly the MX 2004 components were not showing correctly.
Does anybody has actual good, clean code on this?
I have also some test samples (the load is on the 1st frame, you should try to move it to 2nd and 3rd frame)
Download (.zip containing a .fla file and an .as file)
I did find another issue with components when loading them into another swf. You have to make sure this is an instance of your component you’re using on the main fla.
Understand? Say, you’ve got a seperate swf file that has a textarea component, and you’re loading that swf into your main swf. Well, then you’ll need to have an instance of the textarea component on the main swf as well for it to work properlly!
But, I’ve never delt with seperate .as files, and classes etc … so sorry I can’t help. Maybe make a new post in the actionscript section?
I’ve found a similar problem working with attachMovie. Making a lot of objects in your library available to be used with attachMovie (i.e. choosing ‘export for actionscript’) causes a high first frame load which stops your preloader from appearing right away.
I’ve always got round this by making the preloader a seperate movie which loads the main movie into level 1. You can make the preloader movie as lightweight as you like so it appears quickly. All references to ‘_root’ in you main movie will automatically point to _level1 so your code should work without glitches.
I’m looking for a peice of actionscript which will give me a load-bar preloader for an externally loaded .swf file. I’m not great with actionscript (though not totally out of it.) and am currently using the :
if (_framesloaded>=_totalframes) {
gotoAndPlay(3);
} else {
gotoAndPlay(1);
}
approach, which doesn’t give me a loadbar. When I tried to use the loadbar like this:
it failed to work for both the regular movies within MX 2004 as well as the externally loaded ones. I know there’s an easy fix here…I just don’t know what it is.
I have that same problem, and it is a real pain in the butt! It has something to do with whats in your movie because i found if i just made a test movie with only three frames (frame 1, preloader; frame2, assets; frame 3, start of actual movie) I could get the components to behave. Sadly this issue is over my head as well.
would love some help on inserting a preloader on my movie clip wich shows on my home page dim:(304/176) & ( 1.3 mb )
should be simple: (flash mx 2004)
imported mpg into stage took up to ( 285 ) then placed on homepage and works, but browsers still wait 4 movie to load, so would like to insert a basic preloader with bar & percetage. so browsers can see how long to wait 4 movie to load.
had tried all the scripts just does not seem to even play now that i’ve inserted even the simple one above.just stayes blank…
are you suppose to say how many frames to load or just leave script alone…
you guys explane it well step by step wich i’ve done over and over but still no luck…
Hi cmplx, not sure if you figured this one out but it’s dead simple! (Discovered after spending half a day on it!!) :{
Simply change the ‘export frame for classes’ to i.e. 2, then open your library, right-click the component and choose ‘linkage’, then untick the ‘Export in first frame’ option.
You’ll notice that the .swf filesize increases (which is a good sign!), and that the component(s) now work.
Well, I just finished a Flash intro for baltimorejazz.com. It has a preloader attached to it, which displays fine in IE, NN5+, & Opera, but breaks in NN4x(I know, crappy browser), and Firefox.
In the 2 previously mentioned browsers instead of displaying “x% complete,” (where x is percentage complete) it displays “NaN% complete.”
that information just saved me hours of headaches. This is what makes the internet great. After 3 versions of flash documentation blowing pickles with huge inaccuracies and holes (since flash 4 in my opinion), I have just totally given up reading anything they write about their program.
This is, I believe, the FIRST TIME in about 3 years that I have read something in the help panel that not only was well written and not full of inaccuracies, but also ACTUALLY WORKED.
And I would never have known without your blessed post above.