Loading Bar of Preloader Fits to Stage Width

Hi everyone. I am currently using the preloader script below and I would like to make my loading bar auto stretch to stage width. Can anyone kindly give me the directions what I ought to change or addon? Thanks!

// PRELOADER SCRIPT
myBar._xscale = 0;
loaded = false;
timer = 0;

onEnterFrame = function ()
{
loading = Math.round(_root.getBytesLoaded().toString() / 1024);
total = Math.round(_root.getBytesTotal().toString() / 1024);
percentage = Math.round(loading / total * 100);
myBar._xscale = myBar._xscale + (percentage - myBar._xscale) / 5;
percentageTxt._x = myBar._width - percentageTxt._width / 2;
percentageTxt.percentage = Math.round(myBar._xscale);
if (myBar._xscale > 99 && percentage == 100 && loaded == false)
{
myBar._xscale = 100;
timer = timer + 1;

            loaded = true;
            _root.play();
        }

    }