Title: RE: [flashmaestro] Convertir Decimal a Hexadecimal

Estilo OOP

//uso
c = new Color(mc);
c.setColorRGB(255,0,255);

c = new Color(mc1);
c.setColorRGB(255,255,0);


Color.prototype.setColorRGB = function (r, g, b) {

        if (!isNaN(r+g+b) && r<256 && r>=0 && g<256 && g>=0 && b<256 && b>=0) {

                r = (parseInt (r)).toString(16); r.length == 1 ? r = "0" + r : r;
                g = (parseInt (g)).toString(16); g.length == 1 ? g = "0" + g : g;
                b = (parseInt (b)).toString(16); b.length == 1 ? b = "0" + b : b;

                this.setRGB (parseInt("0x"+r+g+b));
        }
}
//salu2

-----Mensaje original-----
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]En nombre de David Rodriguez
Torrontegui
Enviado el: martes, 26 de marzo de 2002 0:59
Para: FlashMaestro (FlashMaestro)
Asunto: [flashmaestro] Convertir Decimal a Hexadecimal


Hola,

Trato de pasar de un numero decimal a hexadecimal. Como puedo hacerlo?
He intentado haciendo parseInt(numero,16) pero creo que eso es para
hacerlo al reves no? Como podr�a hacerlo? Es para asignar un color a un
clip gracias.

---------------------------
David Rodriguez Torrontegui
Getxo (Bizkaia)
[EMAIL PROTECTED]
--------------------------

Responder a