|
-
Different fonts on the same line
I'm importing some text from an xml file. Which looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<rss>
<channel>
<item id="1">
<TitleCopy<![CDATA[<title>jane</title<keywords> - Hopeful | Chatterbox | Ardent</keywords>]]></TitleCopy>
</item>
</channel>
</rss>
I have a css style file. Which looks like this:
title {
color: #A6CE46;
font-size: 24px;
font-family: DivineFont;
}
keywords {
color: #999999;
font-size: 16px;
font-family: NeoSanLightFont;
}
At the moment when the text is loaded into the dynamic text block it looks like this:
jane
- Hopeful | Chatterbox | Ardent
What I want to happen is this:
jane - Hopeful | Chatterbox | Ardent
I'm not asking the "keywords" to drop to the next line. The dynamic text block is long enough to accompany all the text.
Please help
Thanks
-
AKA [ Paul Bainbridge]
your title tag is missing >
-
Yep I missed the > out, but that still doesn't solve it.
Thanks anyhow webdreamer
-
AKA [ Paul Bainbridge]
Can you show the code your using to pull the xml into flash?
-
//frame 1
var xml_load:XML = new XML();
xml_load.ignoreWhite = true;
xml_load.load("copy.xml");
var xml_array:Array = [];
loading_status = function () {
load_txt.text = Math.floor((xml_load.getBytesLoaded()/xml_load.getBytesTotal())*100)+"%";
};
xml_load.onLoad = function(status_load:Boolean):Void {
if (status_load) {
displayText(txt);
for (var i = 0; i<xml_load.firstChild.firstChild.childNodes.length ; i++) {
if (xml_load.firstChild.firstChild.childNodes[i].nodeName.toString() == "item") {
for (var j = 0; j<xml_load.firstChild.firstChild.childNodes[i].childNodes.length; j++) {
switch (xml_load.firstChild.firstChild.childNodes[i].childNodes[j].nodeName.toString()) {
case "TitleCopy" :
TitleCopy = xml_load.firstChild.firstChild.childNodes[i].childNodes[j].firstChild.nodeValue.toString();
break;
}
}
xml_array.push({a:TitleCopy});
}
}
delete xml_load;
nextFrame();
} else {
load_txt.text = "Loading Error!";
}
};
// Load the css file
import TextField.StyleSheet;
var cssUrl:String = "fonts.css";
var css:StyleSheet;
// Deal with a IE/Firefox inconsistency.
function fixUrl(url:String):String {
var rootUrl:String = _root._url;
var iLastSlash:Number = rootUrl.lastIndexOf('/');
if (iLastSlash>0) {
rootUrl = rootUrl.substr(0, iLastSlash);
}
return rootUrl+"/"+url;
}
function loadCSS():Void {
css = new StyleSheet();
css.onLoad = function(bSuccess:Boolean):Void {
if (bSuccess) {
loading_status();
}
};
css.load(fixUrl(cssUrl));
}
function displayText(htmlText:String):Void {
var t:TextField = txt;
t.html = true;
t.styleSheet = css;
t.embedFonts = true;
t.autoSize = true;
t.htmlText = htmlText;
}
loadCSS();
stop();
//frame 2
end_txt = xml_array.length;
xml_reader_page = function (id:Number):Void {
TitleCopy = xml_array[Counter].a;
txt.htmlText = TitleCopy;
};
Counter = 0;
xml_reader_page();
stop();
-
AKA [ Paul Bainbridge]
It might just be easier to post the files.
Are you able to do that?
-
Link to files:
imagesinmotion.zip
Thanks
webdreamer
-
AKA [ Paul Bainbridge]
 Originally Posted by imagesinmotion
sorry i am at a loss as to why it coming out that way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|