alexandergre

Dec 5, 2009, 02:51 PM

mybutton.location.x=158;

mylable.alpha=0;

mybutton is dragable in 259>x>158

I want the mylable.alpha to grow from 0 to 1.0 as the x grows from 158 to 259;

I came up with this:

mylabel.alpha=((myButton.location.x)/259);

It works

but the alpha start from 0.613900 and not 0. becase 158/259=0.61003861

I need another forumla. can you please help.

mylabel.alpha=((myButton.location.x-158)/259) didnt work either.

when x= 158; alpha is 0;

but when x=259 alpha is 0.39

mylable.alpha=0;

mybutton is dragable in 259>x>158

I want the mylable.alpha to grow from 0 to 1.0 as the x grows from 158 to 259;

I came up with this:

mylabel.alpha=((myButton.location.x)/259);

It works

but the alpha start from 0.613900 and not 0. becase 158/259=0.61003861

I need another forumla. can you please help.

mylabel.alpha=((myButton.location.x-158)/259) didnt work either.

when x= 158; alpha is 0;

but when x=259 alpha is 0.39