PDA

View Full Version : Help with loader component



evoramen
February 6th, 2007, 09:22 PM
Hi!
Need a little help.
I'm designing a web site in Flash 8 pro and I needed to load a swf inside another swf, so I have created a movie with a loader component and a progressbar and pointed it to load that swf. It worked fine but the thing is that it starts to play the swf before it's completely loaded. I have some fade in effects that "drop" in the content progressively and it doesn't work because when you start to see the movie it already begun playing and you don't get to see the all animation unless you reload the movie and call it from the browser's cache...
I can't figure out why is this happening and how to fix it.
Please... HELP! Thanks!

If you want to see what I'm talking about just go: http://www.josebatistamarques.com enter the site and click BIOGRAFIA on the bottom left

PS: I tried to add some frames at the beginning of the animation to delay the content drop in to soon but didn't worked

Hunson
February 6th, 2007, 11:58 PM
this.onEnterFrame = function() {
var ammount:Number = this.getBytesLoaded()/this.getBytesTotal()*100;
loaders.preloader._xscale = ammount;
loaders.loadTextMC.loadText.text = Math.round(ammount)+"%";
if (ammount == 100) {
this.gotoAndPlay(4);
loaders.gotoAndPlay(2);
delete this.onEnterFrame;
}
};

evoramen
February 7th, 2007, 01:39 PM
Thanks for the reply Hunson.
I'm not really into code yet...
Started meesing with Flash not too long ago, so didn't follow up your reply...
I thou pasted your code into the movie but didn't work out. Maybe because I have to edit it to match the instancenames of my components?


loader instance name is "loader", progressbar is "progressBar"
this is the code I have on the loader component:

// hides the progressBar on complete
on (complete) {
this._parent.progressBar._visible = false
}



and this I have attached to the frame one:

//progressBar Customization
progressBar.setStyle("themeColor", 0xFFB500);
progressBar.setStyle("fontFamily", "Humnst777 Lt BT");
progressBar.setStyle("fontSize", 10);

Thanks again!