Originariamente inviato da claire
ora sto usando questa funzione e va :
function nCol() {
newr = Math.floor(Math.random()*255);
newg = Math.floor(Math.random()*255);
newb = Math.floor(Math.random()*255);
}
mc.onEnterFrame = function() {
colore = new Color(this);
colore.setRGB(_root.r << 16 | _root.g << 8 | _root.b);
if (_root.r<_root.newr && _root.r<112) {
_root.r += random(10);
}
if (_root.g<_root.newg && _root.g<112) {
_root.g += random(10);
}
if (_root.b<_root.newb && _root.b<112) {
_root.b += random(10);
}
if (_root.r>_root.newr && _root.r>0) {
_root.r -= random(10);
}
if (_root.g>_root.newg && _root.g>0) {
_root.g -= random(10);
}
if (_root.b>_root.newb && _root.b>0) {
_root.b -= random(10);
trace(newr);
trace(newg);
trace(newb);
}
};
setInterval(nCol, 2000);
però non capisco come settare i valori per far rimanere la transizione entro un certo range di colori..
mi spiego.. lo sfondo è nero, per cui se mi va su colori troppo scuri non si vede più un tubo...