# Line breaks?

**URL:** <https://forum.kirupa.com/t/line-breaks/199183>\
**Category:** flash\
**Created:** [August 31, 2006, 4:32pm UTC](https://forum.kirupa.com/t/line-breaks/199183 "2006-08-31T16:32:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![garebear](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@garebear](https://forum.kirupa.com/u/garebear)\
**Post date:** [August 31, 2006, 4:32pm UTC](https://forum.kirupa.com/t/line-breaks/199183/1 "2006-08-31T16:32:39Z")

</div>

The goal = to have different formatted text all in the same text field.

I am inserting text into seperate columns in a XLS Excel spreadsheet. There are 5 columns and each column will have a different formatting to it (which will be applied with CSS later). I turn the XLS into XML with a converter. I then import the XML into flash. I assign each text (from each column) to it’s own variable call (so I have 5 variables for each type of formatting).

I want each of the five text types to be it’s own paragraph in one final text field in flash. I am attempting to add line breaks using the HTML tag \<BR\>. I have told the text box on stage to render text as HTML. Here is the Code I have written (see specifically the blue):

\*\*//--------------------------------------------------------------------------\<initialize XML\>--------------------------------------------------------------------------\  
var myXML:XML = new XML();  
myXML.ignoreWhite = true;  
//--------------------------------------------------------------------------\</initialize XML\>-------------------------------------------------------------------------\  
//-------------------------------------------------------------------------------\<call XML\>---------------------------------------------------------------------------\  
myXML.onLoad = function(success) {  
if(success) {

var BOLD12PT = myXML.childNodes[0].childNodes[0].attributes.BOLD12PT;  
var NORM10PT = myXML.childNodes[0].childNodes[0].attributes.NORM10PT;  
var BOLD12PTUNDERLINE = myXML.childNodes[0].childNodes[0].attributes.BOLD12PT1;  
var RED10PT = myXML.childNodes[0].childNodes[0].attributes.RED10PT;  
var ITALICIZED10PT = myXML.childNodes[0].childNodes[0].attributes.ITALICIZED10PT;

[COLOR=blue][COLOR=black] loadTxt = function() {[/COLOR]  
myTextField.text = BOLD12PT + “\<BR\>” + NORM10PT + “\<BR\>” + BOLD12PTUNDERLINE + “\<BR\>” + RED10PT + “\<BR\>” + ITALICIZED10PT;  
}[/COLOR]  
loadTxt();  
} else {  
myTextField.text = “Error”;  
}  
}  
myXML.load(“CSS\_Testing.xml”); //XML Location  
//-------------------------------------------------------------------------------\</call XML\>--------------------------------------------------------------------------\  
stop;\*\*

This is the output I get when I execute the SWF:

**This text should be bold 12 pt\<BR\>This text should be default 10 pt.\<BR\>This text should be 12pt bold and underlined\<BR\>This text should be default red 10 pt\<BR\>This text should be italicized 10 pt.**

I will worry about the CSS formatting next but why are my line breaks not working?

-Garebear
