Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getBytesLoaded and getBytesTotal isnt getting!

Status
Not open for further replies.

RichGags

Programmer
Oct 6, 2007
2
US
Hi! Im going crazy! It seems no matter how I try to get the bytes loaded and total, its not getting them. Im loading a picture into a holder. The swf loads into the holder fine, but the preloader isnt working because the bytes loaded and total are always 0. Here's the code Im referring to...

function load_pic(myLoad, myNum:Number)
{
//this loads the picture into backpics
_root.mc_backpics["img" + myNum].loadMovie(myLoad);

//this is what I cant get working. myLoad isnt referencing the file I think

total = myLoad.getBytesTotal();
loaded = myLoad.getBytesLoaded();
percent = int(loaded/total*100);


and here's how I call it...
var myPage = 1;
load_pic("backpics/pic" + [myPage] + ".swf", myPage);

Thanks!
Rich
 
Thanks for the quick reply, but it did not work. I think it has to do with the fact Im loading the movie into a holder. Do I have to reference the holder or the movie or both somehow? In the meantime I had posted my source here...



maybe you can have a look. Thanks!
Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top