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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -