PDA

View Full Version : Problem loading XML into a TextArea component


philbert1080
04-10-2006, 12:49 AM
This is the code I am using to load the XML and CSS

_root.main_mc.tickerText.html = true;
_root.main_mc.tickerText.wordWrap = true;
_root.main_mc.tickerText.multiline = true;
_root.main_mc.tickerText.label.condenseWhite=true;

//load css
tickerStyle = new TextField.StyleSheet();
tickerStyle.setStyle("headline", {color:'#286739', fontFamily: 'Verdana, Arial, sans-serif', fontSize: '12px', fontWeight: 'bold'});
tickerStyle.setStyle("date", {color:'#999999', fontFamily: 'Times, serif', fontSize: '9px', fontWeight: 'bold'});
tickerStyle.setStyle("text", {color:'#666666', fontFamily: 'Verdana, Arial, sans-serif', fontSize: '10px', fontWeight: 'normal'});
tickerStyle.setStyle("a", {color:'#333333', fontFamily: 'Verdana, Arial, sans-serif', fontSize: '10px'});
tickerStyle.setStyle("a:hover", {color:'#333333', fontFamily: 'Verdana, Arial, sans-serif', fontSize: '10px' , textDecoration:'underline'});

_root.main_mc.tickerText.styleSheet = tickerStyle;

//load in XML
var tickerContent:XML = new XML();
tickerContent.ignoreWhite = true;
tickerContent.load("ticker.xml");
tickerContent.onLoad = function(success){
if(success)
{
_root.main_mc.tickerText.text = tickerContent;
}
}

For some reason the XML and CSS load into the TextArea ("tickerText.text") but cannot be seen. The scrollbar updates based on the content loaded and the links are clickable, you just can't see any of the text. The text loads perfectly when the TextArea is on the main timeline, but once I place it inside of the main_mc it stops displaying the text. Does anyone have any ideas what I could be forgetting that would cause this to happen?