473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how can I create a line break in a flash string?

I am calling to a large string that is separate paragraphs. I just don know how to put line breaks in flash actionscript. Can anyone help me?

example

tLabel.text = "blah blah blah blah (then a return with a tab indent) blah blah blah"

I just want my paragraphs to show up seperated when the text loads in the textField. Not to appear like one long string of on going sentences.

Thanks,

Nathan
Oct 6 '07 #1
4 33575
xNephilimx
213 Expert 100+
Hi f5leeba, welcome to TSDN!
To put line breaks use the special newline character \n where you want a line break. Also enable word wrapping and multiline, so it automatically wraps the text.

something like this (notice the \n):
Lorem ipsum dolor sit amet,\nconsectetuer adipiscing elit.

Will be renderd as this:
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.

Kind regards,
The_Nephilim

I am calling to a large string that is separate paragraphs. I just don know how to put line breaks in flash actionscript. Can anyone help me?

example

tLabel.text = "blah blah blah blah (then a return with a tab indent) blah blah blah"

I just want my paragraphs to show up seperated when the text loads in the textField. Not to appear like one long string of on going sentences.

Thanks,

Nathan
Oct 8 '07 #2
this does not seem to work.

my string comes up as something\nsomething

has this been tested with htmlText texfields?

PS I cant use <br> as my text comes from an xml file and adding <br> there breaks the XML tags.

using flash CS3 actionscript3



Hi f5leeba, welcome to TSDN!
To put line breaks use the special newline character \n where you want a line break. Also enable word wrapping and multiline, so it automatically wraps the text.

something like this (notice the \n):
Lorem ipsum dolor sit amet,\nconsectetuer adipiscing elit.

Will be renderd as this:
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.

Kind regards,
The_Nephilim
Nov 2 '07 #3
rsdev
149 100+
this does not seem to work.

my string comes up as something\nsomething

has this been tested with htmlText texfields?

PS I cant use <br> as my text comes from an xml file and adding <br> there breaks the XML tags.

using flash CS3 actionscript3
Check out this link on using CDATA in XML, then you can add <br> to an htmlText textFIeld.


http://www.w3schools.com/xml/xml_cdata.asp
Nov 2 '07 #4
you could also use \r\n, which adds a paragraph break, rather than a new line break.

Hoped this helped!
Oct 31 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Roland Dalmulder | last post by:
Hello all, In my PHP script I put a text file into a string. Part of that string is read, changed and removed. The while loop continuest to extract the next part of the string. This goes all...
2
by: Hans | last post by:
Hello, I would like to create more lines by concatenating values. When I use: <select 'This' + ' ' + 'is' + ' ' + 'an' + ' ' + 'example'> the result is <This is an example> (on the same line)....
3
by: Dr. Oz | last post by:
Hi, I am trying to read in a query string from one page and build a link to another page based on the query string. Here's the code I am using to read in the query string: <script...
11
by: KaHuNa | last post by:
I want create a string from a row of my db, but for each rows i need a new string and a new name for the variable. exemple: int i = myRow; string varName = "news"; createNameVar = varName +...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
16
by: lovecreatesbea... | last post by:
It takes mu so time to finish this C source code line count function. What do you think about it? / ******************************************************************************* * Function ...
1
by: Kerem Gümrükcü | last post by:
Hi, i try to create a remote process with Win32_Process.Create, but the remote machine always retruns 9 as result, which say that the path could not be found. Code seems to be fine, except the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.