actionscript 3 - as3 scaleX by percent of mc size -


how scale x of mc percentage?

for example have var percent. starts @ 0 , goes 100. mx.scalex = 33; not work needs .33 or .3 again numbers working 0 though 100 , need percentage of written in ways scalex can handle it.

// other code correct percent; // result 0 through 100 yellowprogress.scalex = percent; 

if percent 100, scalex should 1 - so:

1 (as percent) 1% of 100 (maximum percent), need 1% of 1 (maximum scalex) 0.01. 1% of something, divide 100.

so yellowprogress.scalex = percent / 100; trick.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -