my question is regarding load movie. I am loading a movie into a video clip on my main time line.
When I load it into the movie there seems to be a slight pause 2seconds or so before the movie begins pre-load. My preloader is very small, the .fla containing all the code is 18k if I publish its only 1k, and I certainly havn’t noticed any pauses with it before.
I am just wondering if the pause is likely to be because of my preloader, or whether Flash takes a second or two to load my movie into flash. The pause only occurs online.
If you guys think it is likely to be down to the preloader I would be greatful if someone could post the script for % preloader that won’t cause a slight delay.
PS. I am trying to work this out myself, but my connection is very very irregular! anywhere from 0.5kb to 5kb, I hate 56k modem!
The reason that there is a delay in the loading of your movie is because you are loading it from an external server into your main document, and depending on your connection this delay can range into the seconds. A good suggestion would be to preloader your external movie, that way to the user its not just a blank screen instead theres a preloader.
Here’s the code, attach this to the movieclip that your loading your external movie into:
Ok, right I see.
I had preloader on the sub-movies I was loading in, obviously faster if on the movie clip.
I enterred the code and tried to switch back to normal mode, it says the code has errors. I think firstly there is 1 to many { bracketts, if I remove the extra brackett, I still have 1 error.
it says :
Scene=portfolio, Layer=loadmovie, Frame=201: Line 4: ‘else’ encountered without matching ‘if’
}else{
I understand most of the code, apart from the onclip event(enter), shouldn’t you use on clip event (data) ?
PS. I started the movie in flash 5, so decided to finish in flash 5, I don’t think that should matter though regarding the code.
Sorry, I didn’t type the code I gave you previously in the actionscript window it was just of the top of my head! This is what it should look like.
onClipEvent (enterFrame) {
if (this.getBytesTotal() == undefined) {
total_bytes = this.getBytesTotal();
} else {
loaded_bytes = this.getBytesLoaded();
percent = int(this.getBytesLoaded()/this.getBytesTotal()*100);
_root.bar._xscale = percent;
_root.outputfield.text = int(this.getBytesLoaded ()/this.getBytesTotal()*100);
}
}
onClipEvent(data) would be a good idea if you knew that it was going to be loaded right away but since in might not be loaded right away it is a better idea to use enterFrame. Enterframe checks to see what data is being recieved every frame and loops that frame so it allows for the bar to scale as well as to check and keep checking if the movie has been loaded. Be sure to upload your site to the internet first in order to view the preloader properly since your computer already has it in its cache the file will be loaded immediately.
ok,
well I went to the first instance of the movie I am loading my sub-movies into on my main movie timeline, went to actions and applied the script you put above.
I removed the preloading script from the start of 1 of sub-movies (as a test).
However this movie does not preload atall now, and there is still a pause when its not been loaded into cashe
is the URL and you can see the problems there. I removed the preloader script from the “ablegrafix” movie which is loaded in when you press that button. I left the other sub movies as they were.
for this file I also moved the movie clip I am loading into to the top layer to ensure loading script wasn’t being blocked.
the movie clip I am loading the sub movies into is an empty movie clip - no frames. The registration (center) point of the movie I am loading into is positioned in the top left corner of the window displaying information. I started this animation months ago in Flash 5 so am trying to finish it in Flash 5!
not sure what the problem is, its beginning to pi§§ me off!
the first section “able grafix” is the ONLY sub movie I changed after adding the script. The other sub movies have a preloader at the start of them, but like I said there is a pause…
the first one (now I’ve removed the preloader) doesn’t show any loading script atall - it doesn’t preload. Its not just text, click the “pictures”, unless you are on a fast connection it will screw up because its not been preloaded, it has 3 pictures in total about 100K in size, it won’t allow you to flick between them until they have all loaded in…