In Flash 8 with AS2, one could take this approach:
Code:
//load css
var ss=new TextField.StyleSheet();
ss.onLoad=function(){
businessmarketing.businessmarketingText_txt.styleSheet=ss;
}
ss.load("tour.css");
You essentially create a style sheet object.
Code:
//load XML
var data_xml=new XML();
data_xml.ignoreWhite=true;
data_xml.onLoad=function(){
businessmarketing.businessmarketingText_txt.htmlText=this.firstChild.firstChild.nodeValue;
businessmarketing.businessmarketingText_txt._height=businessmarketing.businessmarketingText_txt.textHeight;
}
data_xml.load("businessmarketing/businessmarketingText.xml");
You create an XML object. Though it looks odd to load the xml file after the onload call, it's because action script is asynchronous and events don't always happen sequentially, therefore, you load the xml file outside the onLoad call to ensure there's some data to show in the text box.
Path's can get tricky when targeting the XML file for the text boxes, but the code is solid. Whew, it's been awhile for Action script coding.
Bookmarks