PDA

View Full Version : _alpha not what I set it to.


flashead
08-10-2005, 10:02 PM
This isn't a problem, more or less just something I noticed and wondered if there's anyone who's heard of a reason for why this is?this.createEmptyMovieClip("myMC", 5);

for (var i = 0; i<101; i++) {

myMC._alpha = i;

trace(myMC._alpha);

} When setting the alpha of a movie clip, if the value is something other than 0, 25, 50, 75 or 100 it actually sets it to a value slightly off with up to 6 decimal places... Why?

Wino
08-11-2005, 02:06 PM
Because _alpha is really a one-in-255 setting. Computers don't do base-10, though.. they only do base-2 (binary), so your number is the closest the computer can come to 0.XX * 255, where XX is the _alpha setting.

At least that's the way I understand it.