-
Senior Member
Help....Preloader external swf files
Hey Guys
I have a swf that calls in external swf files. The preloader works fine on the main swf.
On the external swf files I have also used the code for the preloader so when the main swf pulls in the external file that file preloads itself.
here is the code:
this.onEnterFrame = function() {
var amount:Number = this.getBytesLoaded() / this.getBytesTotal() *100;
preloader._xscale = amount;
if(amount == 100) {
this.gotoAndPlay(3);
delete this.onEnterFrame;
}
}
The issue im getting is that the preloader on the external files dont seem to work at all. I get a black screen until the movie loads.
Any ideas anyone?
Thanks
-
AKA [ Paul Bainbridge]
I am note quite sure where the problem is with your code. I use a similair method myself.
Code:
var bytetotal = this.getBytesTotal();
var ready = 0;
this.onEnterFrame = function() {
var byteload = this.getBytesLoaded();
ready -= (ready - (byteload / bytetotal) * 100) * .25;
var output = Math.ceil(ready) + " % ";
txTitle.text = output;
if (Math.ceil(ready) == 100) {
delete this.onEnterFrame;
txTitle.text = "";
gotoAndStop(2);
}
};
stop();
-
Senior Member
Yeah this is what is doing my head in....My external files dont preload when being called into the main swf....but they do preload if i test the files on their own through flash preview :/
-
AKA [ Paul Bainbridge]
-
Senior Member
I'm afriad the project is over 100mb's so its not going to be possible im afriad.
I guess that aint going to help matters lol
any chance u could do a test for me with 2 swf and one calling the external one in with a preloader?
I know im asking alot but im in a bit of a spot and have hours to get this done
thanks very very much
-
AKA [ Paul Bainbridge]
No need to test i know it works, thats why i need to see the fla.
-
Senior Member
could it be that fact that im using a loader from the flash components to bring in my external swf files?
-
AKA [ Paul Bainbridge]
-
Senior Member
Well i have never used external swf files in flash before.
So i used the loader componant in flash and directed it towards the swf.
Could that be why the external file dont preload? Am i importing external files wrong maybe>
Sorry bit of a noob at this
-
AKA [ Paul Bainbridge]
I have no idea of your setup so couldn't honestly say yes or no.
I have attached a file with fla1(main) fla2(to be loaded into main)
The fla's do exactly what they are supposed to.
file
Hope it helps
-
Senior Member
You are a legend mate...Changing the way I bring in the swf files worked a treat!!
I knew it must be something to do with that...the code looked all right to me for the preloader.
Thanks very much for doing that for me
-
AKA [ Paul Bainbridge]
Ah ha no problem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|