This content has been marked as final. Show 9 replies
Look at the online help example code for either getBytesLoaded or getBytesTotal. There is a a trace statement in the onEnterFrame function . You can place a textField on the stage and set its text property to the same string as that trace statement.
(getBytesTotal / BetBytesLoaded)*100
that will give you the percentage of bytes loaded, just put that into a text field =]
>>(getBytesTotal / BetBytesLoaded)*100
Just an FYI, but with operator precedence, / and * are the same. So the
parenthesis is unnecessary, though still useful for a quick visual of the
order you want. And those are functions:
getBytesTotal() / getBytesLoaded() * 100;
Adobe Community Expert
I am confused. I don't write Ascript... more of a copy paste thing and then I can kind of understand everything once I see it together. I am confused as to how and where this would be written into to initial Ascript I provided in the first post that contains my mask preloader... Also not sure how it is going to reference the Dynamic text field I created I would think it would have to be written something like: var percent:My_Dynamic_Field = getBytesTotal() / getBytesLoaded() * 100
Everyone's help is greatly appreciated!
Ok group, thanks for your help I figured out the % part of this... However, I have a new related question. On this pre-loader I also have part of the logo that reveals during the download using a mask. However I would like to have the mask semi-transparent to show the image and then it fills as the download progresses. I tried changing the alpha of the mask, but the mask is always 100% when testing. So the image doesn't show.
Is there a way to change the alpha of the maks so the part of the logo appears behind and then as the mask shrinks with the download it looks like the faded image is filling?
Thanks again for the help!
enable the cacheAsBitmap properties of the mask and masked movieclips.
As you can probably tell by now I am not a flash expert. Ok, below is what I added to the Ascript for my preloader. However, no matter what I do to the mask movie clip (rectMask_mc), change the alpha or just set the opacity of the rectangle to 50%, it doesn't show transparent. It is all or nothing. I wish I could explain this better... anyways not sure what I am missing. Again, thanks for any assistance.
rectMask_mc.cacheAsBitmap = true;
If you want the transparency to be 50% write it the frame actions panel:
rectMask_mc._alpha = 50;
you need to enable the cacheAsBitmap properties of BOTH the mask and masked movieclips.