The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.38 / 5.00 36,385 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 13,902 Viewshere is my code:
function onProgress (e:ProgressEvent):void
{
var loaded:Number = e.target.bytesLoaded;
var total:Number = e.target.bytesTotal;
var pct:Number = loaded/total;
loader_mc.scaleY = 100 - pct;
loaded_txt.text = "Loading..." + (Math.round(pct * 100)) + "%";
}
loader_mc is a black box over an image over a black background, so when I say scale.Y = 100 - pct, I want it to scale down to reveal the image gradually according to how much has been loaded. Is there anything wrong with my subtraction, or is there a subtraction command I dont know?
Just set the the objects width to that of the percentage loaded. Otherwise, the object is going to be shrinking rather than getting larger.
At 12/13/09 10:04 AM, Deathcon7 wrote: Just set the the objects width to that of the percentage loaded. Otherwise, the object is going to be shrinking rather than getting larger.
the point being, I want the object to be shrinking, so that once it shrinks to 0, the image behind it will show. I just cant get it to shrink.
At 12/13/09 10:06 AM, RadWalrus wrote: Hello sir, we appear to be brothers.
Indeed.
It then becomes a matter of scope. Make sure you're accessing the clip appropriately.
At 12/13/09 10:24 AM, Deathcon7 wrote: It then becomes a matter of scope. Make sure you're accessing the clip appropriately.
I know I am, when I set it to go by the percent loaded it goes accordingly. I think there's a problem with the way I want to subtract...
wait I got it. It was a really dumb mistake. I just had to replace 100 with 1, because the loaded/total is less than one. REALLY stupid of me.