Flash / Flex / ActionScript/XML/StyleSheet — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 11:14, 26 мая 2010
Formatting XML content with a style sheet
<source lang="java">
package{
import flash.display.Sprite; import flash.text.*; public class Main extends Sprite{ public function Main(){ var specialnoteDeclarationBlock:Object = new Object( ); specialnoteDeclarationBlock.fontFamily = "Arial" specialnoteDeclarationBlock.fontSize = "20"; specialnoteDeclarationBlock.fontWeight = "bold"; specialnoteDeclarationBlock.display = "block"; var styleSheet:StyleSheet = new StyleSheet( ); styleSheet.setStyle("specialnote", specialnoteDeclarationBlock); var t:TextField = new TextField( ); t.width = 300; t.wordWrap = true; t.multiline = true; t.styleSheet = styleSheet;t.htmlText = "
Always remember...
"+ "<specialnote>Set styleSheet before htmlText!</specialnote>"+ "
Otherwise, the stylesheet will not be applied.
";} }
}
</source>