En las cajas también podemos usar estilos CSS, para lograr un
diseño mas agradable, para ello, usaremos las siguientes etiquetas:
Etiqueta Descripcion
color Es el color de la fuente. El formato es
hexadecimal #000000. No acepta
las cadenas como blue,red, etc.
display Solo soporta los valores inline, block
y none.
font-family Es una lista de Fuentes, separadas por
comas, que puede tomar el texto.
font-style Es el tamaño en pixeles de la fuente.
Solo contiene su parte numerica,
a diferiencia de un CSS estandar, no
se incluye el subfijo px o pt.
font-italic controla la inclinacion de la fuente.
puede reconocer los valores de
normal e italic.
font-weight controla el ancho de las letras. puede
reconocer los valores de normal y bold.
kerning Soporta los valores true y false. Esta
propiedad solo funciona para las
fuentes embebidas.
leading Es la cantidad de pixeles entre las lineas
de un texto. Si el valor es negativo las
mismas se colapsan.
letter-spacing Es la cantidad de pixeles distribuidos
equivalentemente entre caracteres.
margin-left Margen izquierdo de texto en pixeles
margin-right Margen derecho del texto en pixeles
text-align Reconoce los valores left,right,center
y justify
text-decoration Maneja el subrayado del texto
text-indent Es el numero de pixeles para la indentacion.
¿Como usarlos?
Primero debemos crear un objeto StyleSheet:
var estilo:StyleSheet = new StyleSheet();
luego creamos un objeto generico donde se almacenaran los estilos:
var almacenaEstilo:Object = new Object();
agregar al objeto los valores de los estilos:
almacenaEstilo.fontSize = "bold";
almacenaEstilo.color = "#FF0000";
almacenaEstilo.text-decoration ="none";
enlazamos el objeto de hoja de estilo con el objeto :
estilo.setStyle(".agregando",almacenaEstilo);
instanciamos nuestra clase TextField
var texto:TextField = new TextField();
agregamos propiedades:
texto.width =250;
texto.height =300;
texto.wordWrap = true;
texto.border =true;
texto.background = true;
asignamos el estilo por medio de la propiedad styleSheet:
texto.styleSheet = estilo;
aplicamos el estilo en el texto usando la etiqueta <span class="agregando"> :
var contenido:String =
"<span class="agregando">flashparatodoelmundo.blogspot.com</span>";
asignamos el texto a la caja usando la propiedad htmltext :
texto.htmlText = contenido;
por ultimo lo visualizamos en pantalla
addChild(texto);
Páginas
Datos personales

:ambivalent:

:angry:

:confused:

:content:

:cool:

:crazy:

:cry:

:embarrassed:

:footinmouth:

:frown:

:gasp:

:grin:

:heart:

:hearteyes:

:innocent:

:kiss:

:laughing:

:minifrown:

:minismile:

:moneymouth:

:naughty:

:nerd:

:notamused:

:sarcastic:

:sealed:

:sick:

:slant:

:smile:

:thumbsdown:

:thumbsup:

:wink:

:yuck:

:yum:
Next Post
Entrada más reciente Previous Post
Entrada antigua
Entrada más reciente Previous Post
Entrada antigua
Suscribirse a:
Enviar comentarios (Atom)
Siguenos en Facebook:
fblikebox/https://www.facebook.com/pages/Flash-para-todo-el-mundo/209890732498030
Popular Posts
-
En esta ocasiòn les traigo un juego dedicado al cuento de zimbres, del blog cuentosenlared.blogspot.com. Si quieren la ver la historia aq...