I’m trying to preload a .swf that I can’t change or modify the actionscript for. I made this .swf in another program called xcelsius which takes excel files and converts the data into flash graphs (very cool for what I need it to do), unfortunatley the swf file it creates is around 160k.
I need a preloader that can do what a preloader does, but this preloader can’t be added to the first frame of the loaded swfs .
Load it, stop it, set it to invisible, preload it, when preloaded set it back to visible and let it play.
[AS]
_root.holder.loadMovie(“xcelsius.swf”)
_root.holder.stop
_root.holder._visible = false;
l = Math.round(_root.holder.getBytesLoaded())
t = Math.round(_root.holder.getBytesTotal())
if (l == t) {
_root.holder._visible = true;
_root.holder.play()
}
[/AS]
This has to be placed in a loop to work, so we’ll use a movie’s onEnterFrame. I’ll give it the instance name dummy in this example. Place this somewhere on the main timeline:
[AS]
_root.holder.loadMovie(“xcelsius.swf”)
_root.holder.stop
_root.holder._visible = false;
_root.dummy.onEnterFrame = function(){
l = Math.round(_root.holder.getBytesLoaded())
t = Math.round(_root.holder.getBytesTotal())
if (l == t) {
_root.holder._visible = true;
_root.holder.play();
delete _root.dummy.onEnterFrame
}
}
[/AS]
I’ll give the script a try! Should I use the bottom one or both? I’m still a beginner (sorry).
I am also assuming that the dummy and holder are MC’s, correct? The holder I understand will hold the loaded swf.
Where would you recommend me to put the dummy mc that holds the loop. On the first frame of the main time line or the first frame of the holder? I know you said maintime line but I just wanted to make sure. :crazy:
Is it possible to add a progress bar and if so should I put it on it’s own layer on the first frame as well.
I was able to download a bytes based preloader component. Would something like that work for me and would I have to do some adjusting to the component.
Listen I really do appreciate your help. It’s people like you that make these forums worth while for a schmuck like me.