ActionScript 3.0 :: CDATA Adds Double Line Breaks Automatically?
Apr 16, 2009
it's always the easiest littel thingies that get you blocked and pulling the hair from your head (or what reamains of it).. i got a test xml file and want to load text to an html text inside my flash, simple no, well whatsever i did, i get cdata adding 2 line breaks to the final text field!
this is the xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<foo>
<tst>
[Code]....
View 6 Replies
Similar Posts:
Jan 10, 2012
use CDATA text when passing text to TextFields, if those texts contain fancy stuff... like line breaks.Anyway, I did exactly that, and now have the problem that each line break that is inside the CDATA tags comes out as a double linke break.If for example the text in the XML is like this:
Code:
<txt id="TXT_linkcopied"><![CDATA[Link is
copied]]></txt>
Then it appears in the TextField like this:
Quote:
Link is
copied
The text is assigned to the TextField like this:
Code:
textField.htmlText = "<span class='nice_font'>" + xmlText + "</span>"
I cannot write the span in CDATA directly for several reasons.
View 3 Replies
Mar 5, 2004
Is it possible to load a text file using line breaks as a delimeter rather than having a &var= at the beginning of each line? Like by a for instance? I have a text file with about 1000 lines that I need to load/display.
View 5 Replies
Apr 6, 2011
I'm attempting to add line breaks after the code I've included below. I know that I need to add a " " after the line of text, but I haven't had any success.
textField.appendText(""+ bldg.S11[i].Title.text())textField.appendText("Square Footage: "+ bldg.S11[i].SF.text())textField.appendText("Tenant: "+ bldg.S11[i].Tenant.text())textField.appendText("Status: "+ bldg.S11[i].Status.text())
View 8 Replies
Jun 23, 2007
I'm having a problem with extra lines being added to my text anytime the stylesheet is applied??
Here's the actionscript:
this.createTextField("bodytxt", 0, 50, 30, 430, 200);
bodytxt.html = true;
bodytxt.border = true;
[Code].....
View 3 Replies
Jan 8, 2010
i need to split a large text file into an array at line breaks so one array element = one line.i have tried the using "" in both match() and in RegExp but it doesnt work.i had the g and m flags on. tried the $ sign too.
View 8 Replies
Jul 3, 2009
I'm in the process of teaching myself the components of the CS4 Design Premium package using the Adobe Classroom in a Book series. I'm currently going through the Flash CIAB and i've started using the pen tool. The task involves creating a wave like design across the stage. Whilst this in itself is simple, the final instruction is to click on the first anchor point to close the shape. In the illustration, the closed shape seems to automatically extend around the stage, however when I click on the first anchor point, the line automatically connects between the two points in a straight line.
Am I doing something wrong? The next step is to fill this area, but with the straight line effect that I am getting, this becomes impossible. I should point out that the instruction states that the pen tool line should extend off the stage. I have done this, but even then on clicking on the first anchor point the shape is closed incorrectly.
View 2 Replies
Aug 31, 2011
I am passing a text from javascript to flash. and spliting the text based on "<br>"
Here is my code
Javascript
<script> function printLabel(){ var label = document.getElementById("label1").innerHTML; thisMovie("main").sendText(label);
}
[Code]......
View 8 Replies
Jul 16, 2009
When I use this code:
HTML Code:
<p><span class="boldgold">Flash Player now supports Cascading Style Sheets!</span><br/>
Macromedia Inc. announced today a new version of Flash Player that supports Cascading Style Sheet (CSS) text styles. </p>
it is normally formatted like this:
Quote:
Flash Player now supports Cascading Style Sheets!Macromedia Inc. announced today a new version of Flash Player that supports Cascading Style Sheet (CSS) text styles.However, in Flash, when I load the external text and use CSS to format it, I get an extra line break:
Quote:
Flash Player now supports Cascading Style Sheets!Macromedia Inc. announced today a new version of Flash Player that supports Cascading Style Sheet (CSS) text styles.The way around it is to let the text after the break tag follow that break tag:
HTML Code:
<p><span class="boldgold">Flash Player now supports Cascading Style Sheets!</span><br/>Macromedia Inc. announced today a new version of Flash Player that supports Cascading Style Sheet (CSS) text styles. </p>
Isn't there a way (as2 code?) to have flash format the text just like a browser would if it were a normal html page?
View 0 Replies
Jul 13, 2005
I want to have some line breaks in my XML. I have a the code for ignore white spaces which is eliminating my line breaks. i have tried <br> which doesnot work.
View 1 Replies
Feb 27, 2007
I've got a list I need to place in an XML file, and I need it to display as a list when it's brought into Flash. However, and do not work.
View 9 Replies
Jun 29, 2006
I have this XML File
<?xml version="1.0" encoding="ISO-8859-1" ?>[code]....
now, the problem ... I cant extract the [CDATA[57.14]],[CDATA[14.29]] & ![CDATA[28.57]] to use it ... I tried several things with firstChild,ChildNodes, but no luck ... any one has a simple solution to put all this in an Array so i can get the stuff out to use it ..
View 2 Replies
Sep 1, 2008
I'm new to flash and AS3, and have just figured out how toload an external XML document into a textField, which is thenstyled via an external CSS document. The styling works fine,colours change, font size changes etc... But! And here's myproblem, when the xml data is loaded into the textfield, where Ihave nested styles, it creates a line break.I have created a textField on the stage with an instance nameof: eventsContentTextFieldWhich is set to dynamic, scrolling (with a UIScrollBarcomponent), html and multiline.
View 6 Replies
Jun 23, 2011
This is the MXML I have
[Code]....
None of them create a new line in flex they are both rendered to the screen. How can I create a new line with a php string?
[Code]....
but if I do name.text=data.string; it doesnt even though data.string has the exact same value;
View 3 Replies
Jul 12, 2010
For some reason or another, after a </strong> or </em> tag, flash inserts a line break after it.
So it is like this:
This is some BOLD
text and this is some italic
text.
When it should look like this: This is some BOLD text and this is some italic text.
[Code]...
View 1 Replies
Mar 17, 2010
I have one swf which calls xml having Unicode characters in text box. But it breaks characters from single word at the end of line when displayed.
why it dosent recognise the word just like english text? is there a wayout?
I dont want to insert line breaks in xml.
View 1 Replies
Sep 18, 2009
I am developing an admin tool for a client. There is a textarea in the tool that the client will type out a description for the video he wants to upload. This description sometimes might have a few paragraphs. I am pushing the data from the textarea into an HTML file and saving on the server so that it integrates with his site. My question is, how do I detect the line breaks in the text area and change them to HTML breaks <br> once the user submits the data?
example:
Hello, this is a test.
should be turned into:
this is a test.<br><br>?
View 2 Replies
Jun 22, 2009
I've finally got XML information coming into my text field. Only problem now is that there for every line break in the text, Flash reads it as two line breaks, for example:
XML:
Line 1
Line 2
Flash:
Line 1
Line 2
I found that you can just use the <br> tag in the original text or if I'm using actionscript to input the text I can use or but what if I'm using text generated by a CMS which my client needs to be able to use?
View 10 Replies
Oct 10, 2009
I know you can identify line breaks when working with text files by checking the character equivalent, but is this possible to do with htmlText?
I am making a text editor for my client and I am using the textArea component as the input field with the data stored in an XML. All's well, except for the line break--the textArea is rendered as htmlText so that the client will be able to see the changes made instantly. By default, it works, but the spacing is all screwed up (indents, double-spaces at times), so I decided to condense the whitespace. With this on, it gets rid of the spacing issues since the html is being rendered exactly as coded. The thing is, hitting enter in the textArea does not add <br /> to the htmlText code.
Do i need to overwrite the Enter key with a custom function that inserts a ine break when using the textArea, or is there a way to detect and convert these line breaks in htmlText?
View 6 Replies
Dec 15, 2009
I have a input textfield 200x150 where customers can write their address.
Problem:
Address is written like:
Avenida de presidente
Calle no 2
How can the line break be recognized in the Text field, so the text arrives in the format as written? The text field also has a >restrict<, it does not allow
View 6 Replies
Jan 21, 2010
I'm working on a project in which user data will be saved via php to an xml file on the sever. Using Kirupa's excellent tutorial [URL], I am able (now) to output to the xml file. My question is, does anyone know of a way to create the xml file so that the nodes will appear on seperate lines, as it would were I creating the XML file using Dreamweaver say.
[Code]...
View 1 Replies
Feb 9, 2010
Previously I had posted a thread about trying to format and xml file with line breaks and indents when writing XML files using the xml.sendAndLoad method.I was looking for a way to write the xml like this[code]...
I thought I had solved this by converting the XML to a str in which the line breaks and indents were added in the appropriate places, but as yet I haven't been able to write it to an XML file. I can write a text file using LoadVars, but this isn't useful as the formatting isn't preserved.
View 2 Replies
May 4, 2011
I have a site that compiles to Actionscript 2.0 and Flash player 8. This site utilises XML output from ASP.Net driven database pages. The problem I have is basically that where I have some tabstops set, in certain cases, where the text starting from the first tab stop is over a certain length an unwanted line break is output just before the last word in the entry. (I know it's always the last word since if I put another word on the end of the string the word that was originally on the new line is back in it's proper place - so it doesn't appear to be length related).
Effectively, what I want is as follows:
header1: Descriptive text header 1
header2: Description header 2
header3: Description header 3
header4: header 4 text
Descriptive text here across multiple lines
What I'm getting is something like this:
header1: Descriptive text header 1
header2: Description header 2
header3: Description header 3 with a long
description header4: header 4 text
Descriptive text here across multiple lines
The Xml I am loading is as follows (This has been anonymiezd and the angle brackets changed to '[]')
[?xml version="1.0" encoding="utf-8"?]
[config scrollPosition="right" styleSheet=".stylesheetscv.css"]
[text][textformat tabstops = "50,540,590"]:[tab /]T[tab /]T[tab /]T[tab /]:[br /]
[list_by]CV Entries By Date[/list_by]
[Code] .....
There are appropriate closing tags further down the file. The CSS that relates to this is:
headertext {
display: inline;
color: #008000;
} itemheader {
display: inline;
[Code] .....
In order to get the CSS to overide the settings of the dynamic text field I use an empty TextFormat object tFormat. The XML is loaded with ignoreWhite set to true. Or can I not see the wood for the trees?
View 5 Replies
Feb 10, 2009
I'm trying to split my text at the line breaks, but it won't work. My text is something like this:
[Code]....
Each item is from an XML tag, but I can't keep it as XML, for my own reasons which I won't get into. I form the text thusly:
ActionScript Code:
for (i = 0; i < myXML.childNodes.length; i++) {
node = myXML.childNodes[i];
for (a = 0; a < node.childNodes.length; a++) {
[Code].....
View 2 Replies
Sep 11, 2010
When I add a stylesheet to a textfield, the text breaks at the endtags.Example:
Code:
var dik:Object = new Object();
dik.fontWeight = "bold";[code].....
View 6 Replies
Jan 10, 2006
I need to send the contents of an input textfield by GET to a php script. The problem is the input must be multiline, but cannot allow line breaks orelse it messes up the GET query. Is there anyway for me to replace the line breaks with a html encoded line break (I tried restricting the textfield to specific characters, but the return still caused line breaks)?
View 2 Replies
Oct 31, 2006
i am trying to splice a string between line breaks.
I have text called in using load vars and a text file. The text file called in has a few lines:
line one text
line two text
line three text
I would like to be able to splice that string so that i can create a string just using the second line of text.
View 4 Replies
Aug 27, 2007
been busy on a project (temp: [URL].. where I load in data from a mysql-db in textfields.however when I put this in the db
line 1
line 2
Flash outputs this:
line 1
line 2
with an empty line in between. How can I control this ?
View 4 Replies
Jun 21, 2008
Is there any way to count line breaks within htmlText? It doesn't look like using
Code:
indexOf("<br>");
will work because the renderer has already created the textfield display by the time this code would run. So there wouldn't be any tags to find, just rendered text.
View 5 Replies
Jun 11, 2009
I have a string (from xml) I want to display on stage. Currently I have a text field that I am simply assigning the text to (no problems) but I want to add line breaks at certain points.after reading this line:
"If the text includes a line break (for example, "
" or "
"), the bottom is also resized to fit the next line of text."
found here: [URL]
I got the impression that I could add a string to text with a line break in it? If I try and add it to my xml file it simply writes it out as normal characters.
I am fairly sure I can do it by showing as HTML but was wondering if there was another way ?
View 2 Replies