View Full Version : Formatting textField populated from XML
Spykes
May 14th, 2009, 05:15 PM
I am populating the text of text fields with data from an XML file. I would like to do two things.
The code looks like this:
DSGbox.textFirstName.htmlText = xmlDSG.name.first;
DSGbox.textLastName.htmlText = xmlDSG.name.last;
First, I would like to format the text... bold, font size, etc...
Second, I would like to concatenate the first and last name to appear on the same line without space in between caused by two text fields. I tried the following, but it didn't work.
DSGbox.textFirstName.htmlText = xmlDSG.name.first + xmlDSG.name.last;
Spykes
May 18th, 2009, 07:03 PM
No one has experience formatting XML data?
Digitalosophy
May 18th, 2009, 07:10 PM
Same way you would stylize any textfield, have you searched?
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextFormat.html
kathari
May 19th, 2009, 09:07 AM
Thanks for the link Digitalosophy. I am trying to make some words in a text bold (see this link (http://www.kirupa.com/forum/showthread.php?p=2468128#post2468128)). But according to this text I won't be able to make it bold unless I make it a different textfield which isn't possible in this case. Am I understanding that correct?
Digitalosophy
May 19th, 2009, 11:43 AM
Do you have a sample FLA? Probably something silly that was missed.
kathari
May 19th, 2009, 11:52 AM
Do you have a sample FLA? Probably something silly that was missed.
If you mean me :) :
From Adobe's page: However, for embedded fonts, bold and italic text actually require specific fonts. If you want to display bold or italic text with an embedded font, you need to embed the bold and italic variations of that font.
doesn't this suggest that I can't use them within the same textfield? Or do I need to embed them separately?
I can strip down an FLA but it will take me a little while. Maybe I should put it on my actual Thread.
And if I mistook and you meant to address Spykes, Sorry!
kathari
May 19th, 2009, 12:17 PM
I put an FLA and xml-document in my thread. Here (http://www.kirupa.com/forum/showthread.php?p=2468205#post2468205).
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.