Transition preloader question

Probably been asked before but I searched and searched and could not find the answer to my preloader question/problem…

I’m just trying to add a percentage read out along with the loading bar (in the transition)… can someone lead me to a thread or post a script for this? tanx :wink:

the as im using right now is the script from the tutorial.

loading._xscale = 0;
loading.onEnterFrame = function() {
this._xscale = 100*_parent.content.getBytesLoaded()/_parent.content.getBytesTotal();
};
loadMovie(_root.section, _root.content);
stop();

back to the top :slight_smile:

i have the preloader working but its just a percentage bar and loading text… now i want to add a percentage readout (1%-100%)

can anyone help me out with this? thanks in advance

myTxtBox = (totalBytes/loadedBytes*100)+’%’;

something like that…

:slight_smile:

i will try that thanks… be back soon

ok… i added the script but now my loading bar does not show and the percentage readout stays at NaN%

any other suggestions?

what is the (complete) code your using? finds old script here’s what i used:

total = Math.round(_root.getBytesTotal());
loaded = Math.round(_root.getBytesLoaded());
percent = loaded/total;
this.loaderBar._width = percent100;
loadText._x = percent
100+73;
loadText.text = Math.round(percent*100)+"%";
if (loaded == total) {
gotoAndPlay(5);
}

this is actually the code from the loader tutorial here (kirupa) but i modded it so that the text box followed the tip of the loader bar. example here.

ok… i can get it to work when the site loads… but i’m trying to get it to work during the transition… i used the code from the transition tutorial.

loading._xscale = 0;
loading.onEnterFrame = function() {
this._xscale = 100*_parent.content.getBytesLoaded()/_parent.content.getBytesTotal();
};
loadMovie(_root.section, _root.content);
stop();

http://www.kirupa.com/developer/mx/percentagepreloader.htm

…right. that tute should explain everything to you…

:slight_smile:

ok im an idiot :slight_smile: i must have skipped right over that one… thanks fellas

No problem, its nice to be able to help people sometimes, rather than always asking for help :wink:

Regarding the above discussion on preloaders, if I’ve already created a flash movie with button, etc, and want to ADD a preloader, what would I do. I know how to createa preloader, but how would I then link it to an already created file and what would i need to change in the action script?

Hal

no clue what your asking m8. when you make a preloader you put it in a different scene and goto the main scene…

:slight_smile:

Is it not possible for you to just add two frames to the beginning of your file, and move all the current frames to starting on frame 3? Alternatively, you could create an empty mc into the preloader scene which you then use to externally load the swf file. Then I guess you could use _root. in your loaded swf to tell your preloader how far it has loaded? - I’m hoping someone who knows what they are talking about can help :wink:

Tried adding the two frames, but now I’m getting this strobing effect between the preloader and the actually movie. Not sure why.

I’ll try it again. Do I have to change anything in actionscript? Do I need to place the name of the movie in there, or will it simply go to frame 3? This is the code I’m using at he moment:

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent100;
this.loadText = Math.round(getPercent
100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}

Right, maybe if you post your .fla we I can get rid of the strobing problem.

Tried adding the two frames, but now I’m getting this strobing effect between the preloader and the actually movie. Not sure why.
that’s because you added a blank keyframe, thus your preloader goes back and forth, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off, on, off. (wow. that was one wicked copy paste).

Therefore, add another layer to put your actions; the preloader layer should be visible for the whole 2 frames. (first frame being keyframe, second one being a normal frame)

Figured it out. Got it. Thanks, guys!