hey guys, im sure theres been numerous questions about this, but i couldnt find a string that addressed my particular question.
im trying to get my % # to move along the _X axis with my preloader bar. any suggestions?
just move the text._x with the preload _x or put the text in a MC and move that MC’s _x … not sure if u can move a text_x
Give this code a go
[AS]
_root.onEnterFrame = function()
{
var totalBytes = _root.getBytesTotal();
var loadedBytes = _root.getBytesLoaded();
var percentComplete = (loadedBytes - totalBytes) * 100;
if (percentComplete >= 100) gotoAndPlay(nextScene());
myBar._xscale = percentComplete;
myText._x = percentComplete;
}
[/AS]
myBar would be the instance name of your loading bar and myText would be the instance name of your dynamic or input text box.
Cheers
Shouldn’t this line:
var percentComplete = (loadedBytes - totalBytes) * 100;
read
var percentComplete = (loadedBytes/totalBytes) * 100;
?
The basic equation for something like this goes like…
loadPercentClip._x = loadBarClip._x+loadBarClip._width
This will move the loadPercentClip first to the _x position of the loadBarClip, and then move it along as the loadBarClip expands in _width. This also assumes the loadBarClips registration point is set to the left (or right) and not centered.
hey guys, thanks for all your input and help! ill try that stuff. its actually kinda cool, but last night right after i posted my question here i had an actionscript revelation. it all started to kinda make sense and the script that i added to my preloader script basically just set my instance name “percent”'s _x equal to the _width of my loadbar…i even got the pathing correct. and to my surprise it actually worked…i’m actually learning this stuff! thank you kirupa members!