Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/02/2007, 17:44
Rizzo
 
Fecha de Ingreso: septiembre-2006
Mensajes: 1.193
Antigüedad: 17 años, 7 meses
Puntos: 30
Re: Código para cambiar color de texto

primero dibuja un cuadrado y conviertela a movieclip y como nombre de instancia le pones mc

despues crea un boton y pones en el esto

Código:
on (rollOver) {
	inicio("contacto", true);
}
on (rollOut) {
	inicio("contacto", false);
}
on (releaseOutside) {
	inicio("contacto", false);
}
y en un fotograma vacio pones


Código:
_root.mc._visible = false;
function inicio(nombre_boton:String, ver:Boolean) {
	var my_fmt:TextFormat = new TextFormat();
	my_fmt.color = 0xFFFFFF;
	my_fmt.bold = true;
	my_fmt.font = "Arial";
	_root.mc.createTextField("my_txt", 2, 0, 0, 100, 20);
	ruta = _root.mc;
	ruta._visible = ver;
	ruta.my_txt.multiline = true;
	ruta.my_txt.wordWrap = true;
	ruta.my_txt.selectable = false;
	ruta.my_txt.text = nombre_boton;
	ruta.my_txt.setTextFormat(my_fmt);
	ruta.onEnterFrame = function() {
		ruta._y -= (ruta._y-(_root._ymouse)+30)*0.4;
		ruta._x -= (ruta._x-(_root._xmouse)-5)*0.4;
	};
}