Comunidad de diseño web y desarrollo en internet online

Cargar color de un txt

Citar            
MensajeEscrito el 27 Nov 2007 04:27 pm
Necesito cambiar colores de texto y colores de clip dinámicamente.
Para el clip utilizo:

var n=1;
var gcolor:String;
var localizacion:String = n.toString();
lv2.load("artista"+localizacion+"/textos/lv_contenido.txt");
var lv2 = new LoadVars();
System.useCodepage = true;
lv2.onLoad = function() {
mipresentacion.htmlText +=lv2.presentacion;
mipresentacion.textColor +="0x"+lv2.colorpresentacion;
gcolor="0x"+lv2.colorboton;
asignarcolor();
};


la funcion asignar color es la siguiente:

asignarcolor = function (){
for (i=1; i<=5; i++) {
miobjeto = new Color (eval("bola"+i).relleno);
miobjeto.setRGB(gcolor);
trace(gcolor)

}}


Me hace el trace y sale 0xFFCC33. Resultado me sale negro. La ruta está bien, saben que puede estar fallando.

Por esnandricor

13 de clabLevel



 

msie
Citar            
MensajeEscrito el 28 Nov 2007 02:23 pm
prueba con esto:

miobjeto.setRGB(parseInt(gcolor).toString(16));

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7
Citar            
MensajeEscrito el 28 Nov 2007 02:33 pm
o tambien puedes usar:

miobjeto.setRGB(Number(gcolor));

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.