adobemove
05-16-2005, 05:16 AM
I was going over this tutorial on XML and CSS located here AS.ORG xmlcss (http://www.actionscript.org/tutorials/beginner/XML-Formatted_Content/index.shtml)
And was wondering if there is another way to go about doing this.
Because im using the Xmlconnector too load alot of data in this format and going through and adding drunken monkey to every line would suck and get confusing changing it.
-----------------------------------------------------------------------
the first line of xml looks something like this
<myXml>
<mcc id="1" title="WOW CSS" contents="IM STUCK" linkUrl="http://www.google.com" />
------------------------------------------------------------------------
and i was working on CSS something like this
.titlecss {
font-family: Arial, Helvetica, sans-serif;
font-size: 8px;
font-weight: bold;
color: #000000;
}
------------------------------------------------------------------------
Then im stuck with the ActionScript
var format = new TextField.StyleSheet();
var path = "mydoc.css";
// This is the part below im stuck on, Title is loaded with XML how can i change the paragraph break part <p>title</p> so it loads what
//the title really is in my xml into the titletxt instead of just the word title?
var titleformat = "<br><p class='titlecss'>title</p>";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
titletxt.styleSheet = format;
titletxt.text = titleformat;
} else {
titletxt.text = "Error loading CSS file!";
}
};
Thanks
And was wondering if there is another way to go about doing this.
Because im using the Xmlconnector too load alot of data in this format and going through and adding drunken monkey to every line would suck and get confusing changing it.
-----------------------------------------------------------------------
the first line of xml looks something like this
<myXml>
<mcc id="1" title="WOW CSS" contents="IM STUCK" linkUrl="http://www.google.com" />
------------------------------------------------------------------------
and i was working on CSS something like this
.titlecss {
font-family: Arial, Helvetica, sans-serif;
font-size: 8px;
font-weight: bold;
color: #000000;
}
------------------------------------------------------------------------
Then im stuck with the ActionScript
var format = new TextField.StyleSheet();
var path = "mydoc.css";
// This is the part below im stuck on, Title is loaded with XML how can i change the paragraph break part <p>title</p> so it loads what
//the title really is in my xml into the titletxt instead of just the word title?
var titleformat = "<br><p class='titlecss'>title</p>";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
titletxt.styleSheet = format;
titletxt.text = titleformat;
} else {
titletxt.text = "Error loading CSS file!";
}
};
Thanks