Log in

View Full Version : Preloading external swf's - Action Script 2



jamie_di
07-08-2008, 01:50 PM
Hey,

I'm having an issue with a movie I'm making, I have my main swf and then the external swfs which are loaded into the clip holder.. easy enough.

At the start of the external swf's I have the preloader, this is the same preloader that I have used for the main swf (which works). However, when I post the files live, the external swf's preloader doesnt work.

Any suggestions for this?

Cheers!

Medyman
07-08-2008, 07:18 PM
Do you have any components or external classes within the external swf files? What's the code for your preloader? Which method are you using to load in your external swf files?

Some of the following tutorials might be helpful:
External SWF Preloading (http://www.gotoandlearn.com/player.php?id=27)
Basic Flash Preloader (http://www.gotoandlearn.com/player.php?id=18)
Advanced Flash Preloader (http://www.gotoandlearn.com/player.php?id=19)

jamie_di
07-10-2008, 01:39 PM
Cheers for those links, extremely helpful!

I now have another problem, followed the External SWF Preloading tutorial (learnt a lot about preloading in that).

If you go to this link (http://www.di-live.co.uk/designimage/portfolio.html) and click on one of the links in the flash file, the internal clip begins loading, but then loads again for some reason. The code the preloader is as follows:

var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = Math.round((loaded/total) * 100)
}

mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = "";
}

mcl.addListener(mclL);

mcl.loadClip("http://www.design-image.co.uk/flash/print.swf",holder_mc);

b1.onRelease = function() {
loader._visible = true;
mcl.loadClip("http://www.design-image.co.uk/flash/print.swf",holder_mc);
}

b2.onRelease = function() {
loader._visible = true;
mcl.loadClip("http://www.design-image.co.uk/flash/large.swf",holder_mc);
}

b3.onRelease = function() {
loader._visible = true;
mcl.loadClip("http://www.design-image.co.uk/flash/websites.swf",holder_mc);
}

Obviously changing the mcl.loadClip("http://www.design-image.co.uk/flash/print.swf",holder_mc); part for each section. And the loader movie clip is a layer above the holder clip which disappears once completed.

Any ideas on what's causing preloader to start, complete and then repeat itself? I've had a go at removing parts of code and seeing what happens, but I am having no joy, so any help would be much appreciated!

Thanks in advance.

** Fixed it!**
It turns out that I have fixed it without even realising, I moved the external clips start frame back by a couple and boom, it worked a treat.

Check it out at www.design-image.co.uk (http://www.design-image.co.uk)