hi there
i tried to load
css file into flash for the
xml content in a textfield, but it doesnt work.i guess its how the
css is load. Its never loaded into flash even though the path is correct. ( to the textfield right?) It may be the
css file? im not too sure coz im quite new to
xml together with
css. Hope someone can help me.
codes for flash
Code:
- Code: Select all
function includeCSS() {
_root.scrollable.fcontent.wordWrap = true;
_root.scrollable.fcontent.multiline = true;
_root.scrollable.fcontent.html = true;
var styles = new TextField.StyleSheet();
styles.load("css_workshops.css");
styles.onLoad = function(ok) {
if (ok) {
_root.scrollable.fcontent.styleSheet= styles;
trace(styles)
news_txt.styleSheet = styleObj;
news_txt.htmlText = newsText;
} else {
trace("Error loading CSS file");
}
};
}
css codes
- Code: Select all
/* Filename: styles.css */
.text {
font-family: Arial,Helvetica,sans-serif;
font-size: 11px;
}
.head {
font-family: Arial,Helvetica,sans-serif;
font-size: 11px;
color: #FF9900;
font-weight: bold;
}
.subhead {
font-family: Arial,Helvetica,sans-serif;
font-size: 11px;
color: #3399FF;
font-weight: bold;
}
part of
xml
- Code: Select all
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<workshop_tv>
<w_title>Junior Musician</w_title>
<w_content> <![CDATA[ this is part of the xml( suppose to inherit head form css)
-subheading(inherit the subhead)
-subheading
-subheading]]></w_content>
btw i dun understand how if its unspecified in flash, the
css able to detect how the
xml is structed, and do its job. can anyone explain? thanks!