External movie preloaders

i need help making just a simple preloader for an external movie. all it needs to do is load the movie, nothing special. ive looked on this forum but none of the stuff works. does anyone know how?

Thnx,
Brendan Smith

something like this should work.


this.onEnterFrame = function() { 
     filesize = contentMC.getBytesTotal(); 
     loaded = contentMC.getBytesLoaded(); 
     preloaderMC._visible = true; 
     if (loaded != filesize) { 
          preloaderMC.loadBar._xscale = 100*loaded/filesize; 
     } else { 
     preloaderMC._visible = false; 
     contentMC._visible = true;
} 
} 
}; 

contentMC is the empty MC to load external SWFs into.
preloaderMC is a MC with a loadbar MC within…

I’m looking for a preloader for external swf’s that load into an empty container clip that is within a movie clip which is on the main timeline. I’ve gone through the tutorial here-‘preloader and transition for dynamic files’. I’m not sure how to do the pathing as I’m another timeline up.
you can see what I’m trying to do here
http://www.glowdesignhouse.com
go to portfolio then nissan then buttons 2,3 and 4. here they are attached but it’s too big and I want it to load.
any suggestions?

just add the preloader into the .swf itself.

Is ‘this’ written on the main timeline of the Flash movie, or is it written on or inside a movieclip?

this.onEnterFrame = function() {
// code
};

Thanks.

Go with maximum_flash’s suggestion. Follow any of the preloader tutorials on kirupa.com and put the preloader on your external swf. That way when you load it into your main movie using loadMovie the preloader is the first thing to be seen. Just be careful of using _root in your preloader code on the external swf.

:hr:

<-- sammy

:beer:

I’m trying to put a preloader in the external swf but it never works even when I test it on its own-I think because in the streaming profile everything is in the first frame. It’s just video with a component control bar.
also,should I use _root or _parent or just the full path of the clip i.e.(nissan.containerone.loadmovie.“movieclip1”)?

The easiest thing is to use the full path to the clip. Sometimes this makes it long but you can always set the path to a variable if it gets to be a pain. Others will tell you to use a bunch of _parent’s (e.g. _parent._parent._parent.mymovieclip) but this has never worked well for me.

But yeah, if you are going to stick a preloader in there you’ll probably have to move the other stuff off the first frame.

:hr:

yeah, _parent is a pain.

In my opinion, using preloaders on external swf’s is a pain, if your loading in more than one swf on the same level, you might as well use the same preloader over and over in the swf which the others are loading into.The coding is just as easy, and you don’t have to script the same thing over and over. For this method, instead of using _root to access the main timeline, you just use _level. Simple and effective.

onClipEvent(enterFrame) {
	loaded = Math.round(_level2.getBytesLoaded()/1024);
	total = Math.round(_level2.getBytesTotal()/1024);
	percent = Math.round((loaded/total)*100);
      if (percent == 100) {
         _level2.gotoAndPlay("start");
      }
}


this type of loader can be used over and over to load things into level 2.

I agree with Monkeyfresh.
I use a different way with setInterval but it works the same.You can download a working version with transition thing here
http://www.kirupaforum.com/forums/showthread.php?t=69268&page=2&pp=15
(gridbuttons2.fla )