Como ven, las propiedades soportadas son las más comunes.
El código para crear el ejemplo es:
Código:
//Asociamos la variable estilo al objeto StyleSheet
var estilo:TextField.StyleSheet = new TextField.StyleSheet();
//Acciones a realizar si la hoja de estilo se carga correctamente
estilo.onLoad = function() {
//Aplicamos la hoja al campo de texto
txt.styleSheet = this;
//Habilitamos el modo HTML y le asignamos un borde al campo de texto
txt.html = true;
txt.htmlText = html_txt;
txt.border = true;
};
//Asignamos la hoja styleSheet.css a la variable estilo
estilo.load("styleSheet.css");
//Cargamos de código HTML al campo de texto
html_txt = "<br><h1>Lipsum regular</h1>";
html_txt += "<br><p><span class='negrita'>Lorem ipsum timeam equidem</span> honestatis ius at, illum etiam eos ei. Luptatum verterem per cu. Aeque inimicus est at, te elit ceteras est. Harum impedit te per. Duo quod nibh delicatissimi in, sint error nostro ius ad.</p>";
html_txt += "<br><img src='imagen.jpg' align='left' width='70' height='70'><p>Ea tota <a href='http://www.lorem-ipsum.info/generator3-es'>intellegam sed</a>, laboramu signife ex qui, te illum aeque vivendo sit. An pro ludus doming mollis, quo omnis malis oporteat cu, postea facilisis sit ad. In simul deterruisset has, consul nominavi at usu, <span class='negrita'><span class='italica'>vix ea suas exerci</span></span>. Quodsi adolescens est in, ea accusamus definiebas has. Mea elit cibo elaboraret te. No facete ceteros sed, ei has causae definitionem.</p>";
y la hoja de estilos styleSheet.css posee estas reglas:
Código:
p{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color:#444444;
text-align:justify;
margin-left:12px;
margin-right:12px;
}
h1{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:20px;
text-align:center;
text-decoration:underline;
}
.negrita{
font-weight:bold;
}
.italica{
font-style:italic;
}
a:link{
text-decoration:none;
color:#3B89B0;
}
a:hover{
text-decoration:underline;
}
Usuarios que han visto este tema también han visto...
- Crear un efecto de nieve en Flash
- Manejando Texto en Flash
- Paleta de color Flash
- Proteger SWF con Flash
- Sonido en Flash
Información legal | Política de Privacidad | Contacte con nosotros
Otro proyecto de Factoría de Internet. Copyright© 2003-2008 Factoría de Internet S.L.. Todos los derechos reservados.