I have a full screen flash movie and I made a progress bar that I would like to have equal to whatever the width of the stage is at that time. The code I am using right now is
loadBar.onEnterFrame = function() {
var amount = Math.floor(((getBytesLoaded()/getBytesTotal())*100));
loadBar._width = amount;
percent.text = amount+"%";
if (amount>=100) {
delete loadBar.onEnterFrame;
gotoAndPlay(3);
}
};
Although this code does work, its really setting the bar equal to that in pixels. I need it more along the lines of say if it was at 10%…rather it being 10 pixels, I need it to be 10% of the Stage.width. Any idea on how to do this? Thanks.