关于css样式的外部导入和XML的使用方法

      Other 2004-9-13 9:57
myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite = true;
kungFuStyle = new TextField.StyleSheet();
kungFuStyle.load("kungfu.css");
myText.styleSheet = kungFuStyle;
kungFuContent = new XML();
kungFuContent.ignoreWhite = true;
kungFuContent.load("kungfu.xml");
kungFuContent.onLoad = function(success) {
    if (success) {
        myText.text = kungFuContent;
    }
};
----------------------------
kungfu.css:
drunken {
color: #FF0000;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
display: inline;
}
monkey {
color: #0000FF;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
display: inline;
}
.snake {
color: #00FF00;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
display: inline;
}
--------------------
kungfu.xml:
<?xml version="1.0" encoding="gb2312"?>
<kungfu>
    <drunken>This is some drunken text</drunken>
    <monkey>This is some monkey text</monkey>
    <snake>This is some snake text</snake>
    <dragon>This is some dragon text</dragon>
</kungfu>
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}