Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




TextField Line Breaks And Flash 8vs9



Below is what I have for a simple text field on stage.
The break `<BR>` works in Flash Player 8, but not in F.P.9.
Am I missing something...?



ActionScript Code:
var authForm = new TextFormat();authForm.font = "AuthFont";authForm.size = 12;authForm.color = 0xFFFFFF;authTxt.html = true;authTxt.embedFonts = true;authTxt.multiline = true;//authTxt.wordWrap = true;authTxt.autoSize = "right";var theText = (strAuth + "<BR>" + strTitle);authTxt.htmlText = theText;authTxt.setTextFormat(authForm);



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-16-2006, 05:09 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

TextField Not Showing Line Breaks
This is really weird, I have a dynamic text field with embedded fonts on the stage, with some paragraphs of text in it, I pushed enter a few times, so theres some line breaks in it...

If i test the swf, the text displays correctly. But, if i turn on bold or italic, the line breaks vanish.

So instead of


Quote:




Line one

Line two




I get

Quote:




Line one
Line two




What on earth is going on? This happens with normal fonts like Arial...

Line Breaks In Input Textfield
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)?

Cheers!

TextField Not Showing Line Breaks
This is really weird, I have a dynamic text field with embedded fonts on the stage, with some paragraphs of text in it, I pushed enter a few times, so theres some line breaks in it...

If i test the swf, the text displays correctly. But, if i turn on bold or italic, the line breaks vanish.

So instead of


Quote:




Line one

Line two




I get

Quote:




Line one
Line two




What on earth is going on? This happens with normal fonts like Arial...

Textfield, EmbedFonts, HtmlText And Line Breaks
I'm building a list of links out of a XML file and I need two line breaks after each <a> tag. The problem is, as soon as I put embedFonts in my code, Flash only reads a single <br> tag in my htmlText. Even if I put ten of them one behind the other, there's only one actually being shown. And its works flawlessly without embedFonts enabled!

Adding Line Breaks And Paragraph Breaks In Dynamic Text - Best Method
I'm using dynamic text and wondering what is the best way (heck, any way) to mark line breaks or paragraph breaks. I'm curious about what Flash MX AS 1.0 is capable of/ supports. I have read a little about HTML enabbling and then using HTML tags, which is probably a good solution. Just wondering if there is something else, or if that is supported by AS 1.0 at all.

I have read a few threads on special characters (SC), including Moock's site, but line breaking doesn't seem to be part of SC.

And, I've read this, but it looks like it is for Action Script 2.0:
http://www.actionscript.org/forums/s...ght=line+break

Does anyone know off hand if AS1 supports CSS, or was that new in AS2.

-Thanks,
AB.

I hope everyone is not on holiday.

Flash Css <p> Acting Like Line Breaks
Hi, for some reason when I use


Code:
this.NewsContent.htmlText = "<p>one paragraph</p><p>another paragraph</p>";
the rendered code looks like this:


Code:
one paragraph
another paragraph
when I want it to look like


Code:
one paragraph

another paragraph
I have a whole article and i really hope I can sort this without having to do some sort of bizare find and replace...

M@)

Flash Is Counting Line Breaks?
I'm having a hard time validating my guestbook!
I recently succeeded with removing spaces as characters after some ugly code .
But my dynamic multiple textfields are counting linebreaks as characters !

Any hints?

Flash / XML Problem 'Line Breaks'
Hi Guys,

I have a small problem related to displaying text from my XML file into FLASH. I cant seem to get the paragraph of text to breal onto seperate lines and what happens is that the text goes across in one continuos line.

If i add <br> intop the XML file, when up loaded it casues a major problem with the FLASH.

Heres the site.

Go to MY WORK > WEBSITES

You will see that the first problem is that Software/Technology description dosent stay within the content of the grey border.

It should read:

Quote:




Macromedia Dreamweaver MX, Firweorks MX, Flash MX, HTML, Filemaker Database




Any ideas?
I can provide all or any files needed.

Cheers
Best Wishes
Richard

How To Send Line Breaks To Php From Flash?
Hi,

If i have a multiline input text field in flash, for a user to input their address, how do i get flash to send the lump of text as a variable with any line breaks included.

For example, if the user inputs

John Smith
The White House
End of the Lane

...the varaible gets to php as:

John SmithThe White HouseEnd of the Lane

...which is not what i want.

How do i get flash to include the line breaks? I'm assuming there must be some way of doing this?

Any help much appreciated

Flash Css <p> Acting Like Line Breaks
Hi, for some reason when I use


Code:
this.NewsContent.htmlText = "<p>one paragraph</p><p>another paragraph</p>";
the rendered code looks like this:


Code:
one paragraph
another paragraph
when I want it to look like


Code:
one paragraph

another paragraph
I have a whole article and i really hope I can sort this without having to do some sort of bizare find and replace...

M@)

How Do You Add Line Breaks To Mailto Links In Flash?
Here's what I'm currently using:

getURL ("mailto:?subject=Watch the " + [_root.videoName] + " Wipeout Video!" + "&body=Hi, Click here to watch this great wipeout video, " + [_root.videoName] + ": " + [_root.videoUrl]);

This is how I want the body to be formatted:

Hi,

Click here to watch this great wipeout vide, XXXX:

http://www.url.com

For some reason when I used the %0D code to try and add linebreaks to the body, it's not working. I seems like flash is passing parameters differently than HTML so it cannot be formatted. How can I add the linebreaks?

[F8] Flash To PHP Email Line Breaks Deleted
Hi all -

I have a designed a Flash based interface to send email via PHP.

I capture the variables in Flash using:

var my_lv:LoadVars=new LoadVars();
my_lv.name=name_txt.text;
my_lv.message=message_txt.text;
// ...
// ...
my_lv.send("mail.php","POST");

My PHP reads:

<?php

$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["from"] . ">
";
$headers .= "Reply-To: " . $_POST["from"] . "
";
$headers .= "Return-Path: " . $_POST["from"];

$to = $_POST['to'];
$message=stripslashes($_POST['message']);
//NOTE: I tried $message without stripslashes - same results
$subject=stripslashes($_POST['subject']);
mail($to, $subject, $message, $headers);

?>

Everything is working fine, but when the message is received all line breaks entered in Flash message are deleted making the message one long line. Is there something I need to write into my actionscript/php to allow the message to display properly (including manual line breaks)? I'm guessing (hoping!) it's an easy fix.

Thanks in advance -
sleepydad

Line Breaks Deleted When Flash Variables Sent To PHP
Hi all -

I have a designed a Flash based interface to send email via PHP.

I capture the variables in Flash using:

var my_lv:LoadVars=new LoadVars();
my_lv.name=name_txt.text;
my_lv.message=message_txt.text;
// ...
// ...
my_lv.send("mail.php","POST");

My PHP reads:

<?php

$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["from"] . ">
";
$headers .= "Reply-To: " . $_POST["from"] . "
";
$headers .= "Return-Path: " . $_POST["from"];

$to = $_POST['to'];
$message=stripslashes($_POST['message']);
//NOTE: I tried $message without stripslashes - same results
$subject=stripslashes($_POST['subject']);
mail($to, $subject, $message, $headers);

?>

When the message is received all line breaks using RETURN/ENTER in Flash message .swf are deleted making the message one long line when viewed by the recipient. Is there something I need to write into my actionscript/php to allow the message to recognize these hard line breaks and display properly in the recipient's email client? I'm guessing (hoping!) it's an easy fix. BTW, the messages do display properly in 'some' clients and not others. I need some fix that will correct this across the board.

Thanks in advance -

Line Breaks When Sending Form In Flash
Hello All!

Please please please can someone help me with this - I'm going crazy not being able to work out how to do it!!

I have a form on a flash website; several single line inputs and one multiline input textbox. I send it via a php page, but when I get the email through the message part (from the multiline input textbox) displays as one line, rather than having line breaks, eg below:

Message sent in flash:
"Hello,
I'm sending a message using your flash form.
Thanks,
Chris"

Message displayed in email:
"Hello,I'm sending a message using your flash form.Thanks,Chris"

How comes it will not add line breaks, no matter what I do?!!

Thank you so much in advance!!
Chris

PHP/XML/Flash Combo (extra Line-breaks)
Hey all,

I'm having some problems when calling in data from a MySql database.
I use PHP to generate an XML file, wich then gets called into flash.

any help would be highly appreciated.

What happens is that an extra line-break (or newlin or br or whatever) is added in Flash.

I have put my example here :
http://www.indewulf.be/test/keuken.swf

My xml file is here (doesn't work in IE, works in mozilla) :
http://www.indewulf.be/php/keuken.php

All my text fields have HTML enabled in flash,
this is my main chunk of code :


Code:
var add_next_here = 30;

function GenerateMenu(menu_xml){

var menus = menu_xml.firstChild.childNodes;

var prijs = menus[0].firstChild;
prijs_txt.html = true;
prijs_txt.autoSize = true;
prijs_txt.htmlText = prijs;

for (var i = 1; i < menus.length; i++){
this_menu = menus[i].childNodes;

for (var i = 1; i < this_menu.length; i++){
gerecht = this_menu[i];
gerecht_oms = gerecht.childNodes[0].firstChild.nodeValue;
gerecht_wijn = gerecht.childNodes[1].firstChild.nodeValue;
if(gerecht_wijn == undefined){gerecht_wijn = '()';}

this_gerecht_mc = main_mc.attachMovie("gerecht_mc","gerecht" add i,i);

// set up shortcuts
gerecht_txt = this_gerecht_mc.gerecht_txt;
wijn_txt = this_gerecht_mc.wijn_txt;
//
gerecht_txt.autoSize = true;
// set text
gerecht_txt.html = true;
gerecht_txt.htmlText = gerecht_oms;
wijn_txt.text = gerecht_wijn;

wijn_txt._y = gerecht_txt._height;

this_gerecht_mc._y = add_next_here;

add_next_here += this_gerecht_mc._height + 10;

}
}

bottom = main_mc._y+mask_mc._height-main_mc._height-50;
}

///////////////////////////////////////////////////////////////////////
// Read in XML, run some functions
//////////////////////////////////////////////////////////////////////

var k_xml = new XML ();
k_xml.ignoreWhite = true;
System.useCodepage = false;
k_xml.onLoad = function(success){
if (success){
GenerateMenu(this)
}
else{
trace ("Error loading XML file");
}
};

k_xml.load("http://www.indewulf.be/php/keuken.php");

<strong> Tags Forcing Line-breaks In Flash
So I have created a textField that has a CSS style applied to it using embedded fonts. I have in-line <a href= > links that display fine - and even <strong> works - but, it creates a line-break after it.

I thought maybe the closing tag had a line-break character ('
') after it, so i tried replacing it if it existed:

ActionScript Code:
text.split('</strong>
').join('</strong>');

but no success.

I have a feeling this might be an actual Flash flaw. Does anyone know?

Flash Strips Out Line Breaks When Sending Variable To Javascript
I'm trying to pass a string from a textarea component OR a normal input text box from within flash to a javascript variable on the page, and back again. I can pass back and forth no worries, but flash seems to remove all line breaks.

Check out my sample htm / fla / swf for an example.

How do I do this - both ways, preserviing as much of the formattin as possible? (Would prefer not to have to use rich text / html)

Flash Adds Extra Line Breaks In My Database Records
I have a Flash movie that pulls records from a MySQL table through PHP, and lists them in succession in a dynamic text field. Some entries are showing extra breaks between lines. Very annoying.

Any ideas?

Flash Putting Too Many Line-breaks In Dynamically-loaded Text...
Here's how it goes:
- User types into multiline textbox in HTML form
- Text gets inserted into MySQL db
- Text is retrieved via PHP and passed to Flash
- Flash displays it in a textbox


The thing is, there are always too many line-breaks. For example, where the user has typed one line-break, Flash inserts 2 or 3. So basically, there are huge spaces between lines/paragraphs.

When I print the text to HTML file via PHP, it looks fine.

Is there a step I'm missing?

External Text Files In Flash: Getting The Line Breaks To Display Properly (HELP)
Jackass linebreaks!
nightmare. does anyone know of a way to get Flash to read the line breaks in Windows text files as single line breaks, and not double line breaks? I know about Flash thinking that "
" is a double line break, so I need to figure out a way to get around that using the code I have:


Code:


var XMLfile = "article_setup.xml";
importXML = new XML();
importXML.varTarget = this;
importXML.ignoreWhite = true;
importXML.onLoad = function (success)
{
if (success)
{

var vt = this.varTarget;
var root = this.firstChild;
vt.articleObj = new Object();
allArticles = root.childNodes;
for(var i=0; i<allArticles.length; i++)
{
article = allArticles[i].childNodes;
vt.articleObj["article" + i] = new Object();
vt.articleObj["article" + i].articleName = article[0].firstChild;
vt.articleObj["article" + i].articlePath = article[1].firstChild;
}
var i;
for (i=0; i<allArticles.length; i++)
{
listBox.addItem(vt.articleObj["article" + i].articleName);
}
select.onPress = function()
{
var myVariable = new LoadVars();
myVariable.onLoad = function(success)
{
if (success)
{
addText(this.article);
}
else trace("Error loading content.");
}
myVariable.load(vt.articleObj["article" + listBox.getSelectedIndex()].articlePath);
}
}
else
{
trace("ERROR PARSING XML");
}
};

function addText(textContent)
{
pbox.htmlText = textContent;
}

importXML.load(XMLfile);

stop();

Line Breaks
I'm using Flash 5 and I have a string of text that i've applied an effect to. Is there a way to break this string into 2 or more lines of text?

Line Breaks
When assigning text to a dynamic text box by a variable how do you indicate a line break?

Line Breaks
how do u make a line break in dynamic text???

i for get, is it some thing like /"r/"

cause it aint coming up

any ideas any one???

Line Breaks In Xml?
why is it that when i load an xml file in flash locally there are double line breaks for returns in the xml, and when I upload it to my server, there is just 1 line break?

XML, Get Rid Of Line Breaks?
i have this XML that i am importing for use as a nav:

code:
<subNav>
<market>Real Estate Merchandising
<example>Example 1</example>
<example>Example 1</example>
<example>Example 1</example>
<example>Example 1</example>
<example>Example 1</example>
<example>Example 1</example>
</market>
</subNav>


the problem that i am having is that the line break after 'Merchandising' is not needed. How can i get rid of this via code in flash?

thanks

[F8] Line Breaks
Hello! This is my first ever post, and I have to say I am a total flash newbie. I would have posted this in the newbie section but I feel that it may be better answered by a 'coder'. I think!

I've built a website, i've kind of somehow got it to work (I'm not a website developer at all really, just a guy who like fiddling around and making things!)

here is the site: www.audio-freaks.com

I have two problems/questions.

1) In the contact page, I have created a way to auto-populate an email. It works ok & gets the job done. BUT when I tried it on a friends computer, it no longer worked right - it didn't recognise the line breaks. I have since discovered that on 'outlook' it works fine, and on 'outlook express' or mac 'mail' it has no line breaks. Please could somebody tell me a way to make it work regardless of system/email client. Basically the email body contains a string that contains line break symbols (i've tried

etc )

2) I've used the scrollplane component to make my scroll zones. It works fine, but looks really ugly! I've tried to get my head round skinning but just can't seem to get it to work. Could somebody please help me change the colour of those dull grey bars? Doesn't need to be flashy, just to darken them & make them more contrasty would be fine.

If anybody could help me with any of these I would be very grateful.

thanks
Dale

PHP To Txt Line Breaks?
Hi all

can someone please help me to rewrite this php code so that the resulting txt file has a line break after each variable. right now it is a single line 600km's long.

<?php

$userName = $_POST['userName']; /
$userEmail = $_POST['userEmail'];
$userScore = $_POST['userScore'];
$userCity = $_POST['userCity'];
$userSex= $_POST['userSex'];
$userNews= $_POST['userNews'];
$userQone = $_POST['userQone'];
$userQtwo = $_POST['userQtwo'];
$userQthree = $_POST['userQthree'];
$userQfour = $_POST['userQfour'];
$userQfive = $_POST['userQfive'];
$userQsix = $_POST['userQsix'];
$userQseven = $_POST['userQseven'];
$userQeight = $_POST['userQeight'];


$add = $userName .
"<" . $userEmail . ">".
"<" . $userScore . ">".
"<" . $userCity . ">".
"<" . $userSex . ">".
"<" . $userNews . ">".
"<" . $userQone . ">".
"<" . $userQtwo. ">".
"<" . $userQthree . ">".
"<" . $userQfour. ">".
"<" . $userQfive . ">".
"<" . $userQsix . ">".
"<" . $userQseven. ">".
"<" . $userQeight. ">;",;
$open = fopen('users.txt', 'a');
$write = fwrite($open, $add);


if($write) {
echo "&verify=success&";
} else {
echo "&verify=fail&";

}

?>



thanks for your help

J

Line Breaks With What? Really
Can I use
or in the middle of a piece of Actionscripting like this:

mailVars.messageb = unescape("Dear " + name_txt.text + "," +

"Thank you for showing an interest in...");

If not, what is a good substitute?

Line Breaks
I'm trying to figure out if it's possible to count the number of line breaks so that if that number is greater than the number of lines a dynamic text field will display a scroll next and previous navigation will appear. Any help would be appreciated. I searched through the forums but didn't have any luck finding what I was looking for.

Line Breaks?
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;

loadTxt = function() {
myTextField.text = BOLD12PT + "<BR>" + NORM10PT + "<BR>" + BOLD12PTUNDERLINE + "<BR>" + RED10PT + "<BR>" + ITALICIZED10PT;
}
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

Using Line Breaks In XML
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.

Anybody know? thanks!

Line Breaks Within XML
I have been searching around for the solution on how to put a line break in an XML file...I went through the xml tutorial, but would like to extend its functionality and insert line breaks and perhaps lists (line breaks would be fine for now)

Any help would be appreciated!

Xml Line Breaks
Hi,

I'm trying to get line breaks in my xml document to show up in my swf. <br> tags dont work, /n doesnt do anything.

I have ignore white space in my actionscript. Anyone have any ideas? Thanks.

Rob

Trace Out Line Breaks?
I am playing around with text fields, and I am not finding a way to trace out line breaks in text fields. Anyone know how to do this?

Loadvariables - Line Breaks
I have txt file like this -

txt=Establish a share vision
and work towards it!

In textfield it displays huge line spaces, but I have only one line break. This is what I got from debugger -

"Establish a share vision
and work towards it!"

Flash inserts automatically an
but also an
- what is
?
How can I display the loaded text correctly in textfield?

AS Panel Line Breaks
Is there any way of being able to write line breaks without a "statement ending" error?

EX:

Code:
var myText:String="
This is my text with
line breaks
and not ends.
";
This abviously gives errors, but im wandering if theres a way to edit the AS error handling or add some sort of syntax to act like PHP and see the line breaks as
and not as statement ends.

[F8] XML Loading With Line Breaks.. PLEASE HELP
Hello There,

in my application i am loading 5 to 10 XML files from the same folder of SWF..
its done in Flash 8..

but my client says.. they dont need to see (10) XML files in the folder.. they need a swf file only..

is there any way to use that in flash.. as text variables ,etc ?

i tried to change the code from . this to

var gXM = new XML();

gXML.onLoad = myLoad;
gXML.load("myxml.xml");

function myLoad(ok) {
.............
....................



------------- i chagned the code to

xmlStr("<xml><object>...<object/></xml>"); - <<<< its not working for multi lines XML .. its working for 1 line only. (line breaks)

var gXML= new XML(xmlStr);
//gXML.onLoad = myLoad;

myLoad();

Thanks a lot...

please help me..its urgent :-)

Line Breaks In Strings
Hi, I visit this site alot and I thought I would register and ask for some help!!


okay I have a string variable

var infobox:String;

and I put the dynamic text box on the stage assign the VAR name _root.infobox
and make the box large enough for a few lines of txt.

So I insert the info txt by using

_root.infobox = ("Oh so you have traveled far from another Lords estate and one of you companians has been...");

and when I test it, I noticed that the dynamic txt box does not Auto break or wrap it. So it goes off the Readable area. Which I why I need some help on making line breaks for this.

Any contenders?

Textfields And Line Breaks....
Im not sure if anyone can help me, but could possibly be something small...

Im building a Flash application, and Input textfields are used to pass text data to a mySQL database, im also using FPDF to convert the data from the mySQL database to a PDF form on the fly...

the main process is fine, but when the user enters text into the input fields (these are flash fields) and clicks the submit button the database appears fine with the submitted text with correct line breaks... but in the PDF all the line breaks are ignored? it's only fixed when i log into PHPmyAdmin and click "go" (i.e. save) on each record... i don't even have to modify the text data in the database but just save the database again as though i have edited something but really i haven't. Seems quite wierd?

the problem is whether it is a Database problem or a Flash problem?

I have no idea...

HTML In XML And Line Breaks
Hi all,

Have trawled various forums and tried every possible combination but cannot find a solution to my problem:
I have an XML file containing some simple HTML markup. The HTML contains both bold text and line breaks. Something like this:

Code:
<data>
<message><p>This is some <b>bold</b>text and this <br/> is a linebreak</p>
</message
</data>
I am putting this in a text field using:

Code:
textField.htmlText = xml.message
I cannot achieve both bold text and line breaks. I eiher get bold text and no line breaks or line breaks before and after the bold text.
I have tried converting to the text to a string, putting the HTML block into CDATA (that is, everything between the <message> tag). I have tried every possible combination using textField.condenseWhite, XML.prettyPrinting, ignoreWhitespace etc etc. I have tried putting the xml node straight into the textField, both with CDATA and no CDATA, no difference. I have used both E4X and "normal" xml parsing. I am not using embedded fonts but system fonts. I have put multiple <br/> tags in but they get ignored if I put CDATA around, if i remove the CDATA I get line breaks all over the place. No CDATA and prettyPrinting removes line breaks after the bold but also removes the "real" line breaks (the <br/> tag) as well.
I want to be able to have both bold text and line breaks where I want them.
I'm going crazy here, anyone has any suggestions? Do I have to write my own parser for this simple HTML text?
Thanks!

Wordwrap And Line Breaks?
so i have a createTextField, set wordwrap to true. great

unfortunately, on certain users it's not detecting the wordwrap very well and putting an extra space on the left margin for some words?

any workarounds or fixes for this?

Inserting Line Breaks In XML
Hi there,

I have an XML file linked to a Flash Movie, which picks up the relevant text from the XML and inserts it into one single static multiline text box within the movie. I would like to know how to insert a line break into the XML so that the text appears on a new line within the text box in the Flash movie.

Just putting the text on a new line within the XML causes two line breaks to appear in the Flash movie.

I'm wodering, therefore, if there is a line of code, or a tag I can use within the XML that let's Flash know to display the next piece of text on the next line.

Thanks for your help,

Dave

Line Breaks Problems...
Hi!

In a Flash Interface, users can write and send messages.

Even if they use "carriage returns" in their message like, for example:

"Hi!
How are you?
I feel fine.
Shall we have dinner tonight?
Hugs and kisses,
Jeff"

the message sent is on only one line like, for example:

"Hi!How are you?I feel fine.Shall we have dinner tonight?Hugs and kisses,Jeff"

Any solution platform and browser independent?

Thanks in advance for your tips!

PHP Deletes .swf Line Breaks
Hi all -

I have a designed a Flash based interface to send email via PHP.

I capture the variables in Flash using:

var my_lv:LoadVars=new LoadVars();
my_lv.name=name_txt.text;
my_lv.message=message_txt.text;
// ...
// ...
my_lv.send("mail.php","POST");

My PHP reads:

<?php

$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["from"] . ">
";
$headers .= "Reply-To: " . $_POST["from"] . "
";
$headers .= "Return-Path: " . $_POST["from"];

$to = $_POST['to'];
$message=stripslashes($_POST['message']);
//NOTE: I tried $message without stripslashes - same results
$subject=stripslashes($_POST['subject']);
mail($to, $subject, $message, $headers);

?>

When the message is received all line breaks using RETURN/ENTER in Flash message .swf are deleted making the message one long line when viewed by the recipient. Is there something I need to write into my actionscript/php to allow the message to recognize these hard line breaks and display properly in the recipient's email client? I'm guessing (hoping!) it's an easy fix. BTW, the messages do display properly in 'some' clients and not others. I need some fix that will correct this across the board.

Thanks in advance -

XML Mysterious Line Breaks
Hi everyone!

I'm new to flash and AS3, and have just figured out how to load an external XML document into a textField, which is then styled via an external CSS document. The styling works fine, colours change, font size changes etc… But! And here's my problem, when the xml data is loaded into the textfield, where I have nested styles, it creates a line break.

I have created a textField on the stage with an instance name of: eventsContentTextField
Which is set to dynamic, scrolling (with a UIScrollBar component), html and multiline.
Any help is much appreciated as I am about to do something drastic!


Below is my actionScript:









Attach Code

eventsContentTextField.embedFonts = true;

var eventsCss:StyleSheet = new StyleSheet();
var eventsCssLoader:URLLoader = new URLLoader();
eventsCssLoader.load(new URLRequest("eventsCss.css"));
eventsCssLoader.addEventListener(
Event.COMPLETE,
function(event:Event):void {
eventsCss.parseCSS(URLLoader(event.target).data);
eventsContentTextField.styleSheet = eventsCss;
}
);


var eventsXmlLoader:URLLoader = new URLLoader();
var eventsXml:XML;
eventsXmlLoader.addEventListener(Event.COMPLETE, onEventsXmlLoaded);

function onEventsXmlLoaded(e:Event):void
{
eventsXml = new XML(e.target.data);
trace(eventsXml);
eventsContentTextField.text = eventsXml;
}


eventsXmlLoader.load(new URLRequest("eventsContent.xml"));


-------------------------------------------------

XML:

<tradeshows>

<month>October
<showname>Tasman Allied Expo</showname>

<showblurb> Looking to enjoy great prices, new products and old favourites - all available on one day and under one roof. The Tasman Allied EXPO's are coming up so mark these dates in your diary!</showblurb>

<showdetails>
<showvenue>Auckland - Ellerslie Race Course<showdate>Tuesday September 30th - 11-6pm</showdate></showvenue>
<showvenue> Christchurch - Riccarton Park<showdate>Tuesday October 7th - 12-6pm</showdate></showvenue>
<showvenue>Wellington - Westpac Stadium<showdate>Tuesday October 14th - 11-6pm</showdate></showvenue>
</showdetails>



</month>



</tradeshows>

-------------------------------------------------

CSS

tradeshows {
font-family: Antique Olive Std;
}

month {
color: #FF9900;
font-size: 12pt;
font-weight: bold;
}

showname {
color: #FFFFFF;
font-size: 12pt;
}

showblurb {
color: #FFFFFF;
font-size: 9.5pt;
}

showdetails {
color: #FF9900;

}

showvenue {
font-size: 9.5pt;
color: #FFFFFF;
}

showdate {
color: #FF9900;
font-size: 9.5pt;
}

Stupid Line Breaks
I am having troubles with my text files having an extra line break added to it.
I have found this thread,
http://www.kirupa.com/forum/showthre...le+line+breaks
But it didnt help.

The wierd thing is it works absolutely perfect on my server (Unix w/Apache) but not on the clients server ( Winblows )
Any one else find a solution other than condenseWhite=true? Because thats not working.

Josh

edit: found out there is a bug when uploading to a windows server. Just another reason to hate winblows
See attached for the solution I found.

Can a mod change the title to [Resolved] please :-)

AS2: Line Breaks In String
I have been making a string by adding textfield values together for example:

_global.String1 = _global.String1 + _root.textfield1;

This is fine and it adds but it puts a line break in for some reason - Is there any reason why it would be doing this and how to get around it?

Line Breaks In A String
Hi

I would like to know if theres a way to add line breaks in a string. Like if i have a text field with intance name text_txt, and then i will have a function that will tell that text_txt.text is equal to a big string, but i want to display it with line breaks. And one more thing , i dont want to use html code to format the text.

I appreciate any help

Thank you

Weird Line Breaks?
Ok..
goto http://www.jacksrambles.com/test and click on blog. This then loads information from my database. If you scroll through my blog entries you'll notice that after the first entry there is a huge line break and then the rest after the line break are spaced evenly as desired.
How do i get read of this annoying linebreak so that all the text is spaced evenly like the ones after the first entry.

Heres my PHP code:
Code:

<?PHP

$link = mysql_connect("#####","#####","#####");
mysql_select_db("jack777_site");

$query = 'SELECT * FROM news';
$results = mysql_query($query);

echo "<?xml version="1.0"?>
";
echo "<news>
";


while($line = mysql_fetch_assoc($results)) {
   echo "<item>
";
   echo "<date>" . $line["date"] . "</date>
";   
   echo "<title>" . $line["title"] . "</title>
";
   echo "<entry>" . $line["entry"] . "</entry>
";
   echo "</item>
";

}


echo "</news>
";

mysql_close($link);

?>

And heres my Actionscript:
Code:

#include "newsScroll.as"
var theXML:XML = new XML();
theXML.ignoreWhite = true;
news_txt.html = true;
theXML.onLoad = function() {
   var itemNodes = this.firstChild.childNodes;
   for (i=0; i<itemNodes.length; i++) {
      var date = itemNodes[i].childNodes[0].firstChild.nodeValue;
      var title = itemNodes[i].childNodes[1].firstChild.nodeValue;
      var body = itemNodes[i].childNodes[2].firstChild.nodeValue;
      news_txt.htmlText += date+"<br>"+title+body+"<br><br>";
   }
};
theXML.load("http://www.jacksrambles.com/news.php");

Copyright © 2005-08 www.BigResource.com, All rights reserved