Anyone have some experiance with Actionscript in Flash?
I'm not much of a programmer unfortunately so my abilities are kind of limited here
Basically I am making a really simply preloader for about a 1 meg flash video (just to let those on dialup know its actualy loading something...).
Ne ways, its a super basic non graphical one (I couldnt figure out how to make the progressbar componet included in flash mx 2004 do anything...)
Basically its just a dynamic text box that has text loaded into it by action script
Code:
onClipEvent (enterFrame) {
var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
if (bytes_loaded == bytes) {
_root.gotoAndPlay(2);
this.kirupatxt = "movie loaded";
} else {
_root.gotoAndStop(1);
this.kirupatxt = "loading (" + bytes_loaded + "/" + bytes +")";
}
} "kirupatxt" is the name of the dynamic text box that was converted into a movie clip
The above script is from some tutorial I found online
Ne ways, I modified it very slightly so that it would display the percent as well
Code:
onClipEvent (enterFrame) {
var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
var progress = bytes_loaded / bytes * 100
if (bytes_loaded == bytes) {
_root.gotoAndPlay(2);
this.kirupatxt = "movie loaded";
} else {
_root.gotoAndStop(1);
this.kirupatxt = "loading (" + bytes_loaded + " Bytes" + "/" + bytes + " Bytes" + ")" + "\r" + "Progress: " + progress + "%";
}
} It works... but it shows the percentage as what I would call a "long" integer format (I think tahts what it was called in visual basic, only programing experiance ive ever had - about 2 years ago so i forgot most of that lol).
Just wondering how I can control the number of decimal places it displays, or if its easier, just to display it as whole numbers rather than any decimals.
Thx,
Vhockey86