Comunidad de diseño web y desarrollo en internet online

TipeWrite

Citar            
MensajeEscrito el 16 Feb 2009 10:03 pm
hola

estoy usando un tipewrite y no puedo cambiarle el color a mi texto :cry: , funciona correctamente solo por ese detalle :lol:

el tipewrite esta compuesto de la siguiente manera.

en flash tengo las acciones:

Código :

mystring = "mi texto";
// --
var myformat:TextFormat = new TextFormat();
myformat.font = 'Book Antiqua';
myformat.size = 11;
myformat.align = 'justify';
// --
_root.createTextField("mytext", 1, 59.0, 191.7, 410, 200);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.setNewTextFormat(myformat);
// --
var tpw:Typewriter = new Typewriter(mytext, mystring, 20);


y un archivo .as

Código :

import mx.utils.Delegate;
class Typewriter  {
   private var interval:Number;
   private var string:String;
   private var speed:Number;
   private var textfield:TextField;
   private var index:Number;
   public function Typewriter (textfield:TextField, string:String, speed:Number) {
      this.textfield = textfield;
      this.string = string;
      this.speed = speed;
      index = 0;
      interval = setInterval(Delegate.create(this, exec), this.speed);
   }
   private function exec() {
      this.textfield.text = this.string.substr(0, index);
      index++;
      if (index > this.string.length) {
         clearInterval(interval);
      }
   }
}


como logro cambiar el color al texto, ya q sale en negro.

supongo q debe ser algo como: myformat.color = '#231312'; pero probe y no es asi, en q me confundo? :?

saludos

Por Rakin

Claber

140 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Feb 2009 11:42 pm
Hola:

Código ActionScript :

// --
var myformat:TextFormat = new TextFormat();
myformat.font = 'Book Antiqua';
myformat.size = 11;
myformat.align = 'justify';
myformat.color = 0xC4C4C4;


myformat.color recibe un color de tipo RR GG BB. Suerte.

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox
Citar            
MensajeEscrito el 17 Feb 2009 01:01 am
muchas gracias LongeVie :)

ahi estaba el error :lol:

saludos

Por Rakin

Claber

140 de clabLevel



 

firefox

 

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