Hello,
I have a image that loads on a button click. The image is quite big and takes a while to load. I want to add a loading bar to the button.
Code for button
this.onRelease = function() {
filesize = obj.picture.getBytesTotal();
loaded = obj.picture.getBytesLoaded();
obj.preloader._visible = true;
if (loaded != filesize) {
obj.preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
obj.preloader._visible = false;
if (obj.picture._alpha<100) {
obj.picture._alpha += 10;
}
}
};
It is not working. Can anyone help?
Thanks