ActionScript 2.0 :: Line Breaks In Input Textfield?
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)?
when I put WordWrap on in an input textfield, all characters off the width of the textfield get put on the next line. However, when I look at the htmlText property of that textfield, I see no evidence of such a line break.I've learned that's because it's a soft line break, and not a hard line break. My app has a feature that requries me to know the number of lines in the textfield. I had been calculating this by simply scanning through the htmlText property of the textfield and counting up the presence of "</p>". However, the wordwrap soft line breaks don't leave any evidence of such in the htmlText property
I have a TextField that uses a stylesheet and gets its text as htmlText. That text is read from an *.xml file with the neccessary CDATA tag. The htmlText is read correctly (I have a debug output to check that), and when displaying the .text attribute, it shows line breaks as expected. multiline, wordwrap and condenseWhite are enabled. No AutoSizing is done, instead I set width and height of the field manually.
But the text it actually shows on the screen is all shown in one line, with multiple lines being drawn in the same line. It also seems to interpret the html correctly, as the words with '<b></b>' around them are bold. Only the line breaks are not working. The height can't be the problem as I set it manually to a value high enough, and debug output shows that it really has that height.
This only happens when viewing the *.swf online and only with empty cache. When I press F5 in the window, the TextField works as intended. So it works offline and when it has already been loaded.
But the creation, scaling of the TextField and filling the TextField with text is all done in the same function, without any breaks so I really don't know how the cache could possibly affect this.
I've create an email form in flash that uses ac3 and php to send out an email when the users click on the submit button. However, the email I receive loses all line break information. example: user inputs: hi there form I will get an email that is 1 line only "hithereform"
Here is the ac3 code: var email_data:String = "name=" + contactName_txt.text + "&email=" + contactEmail_txt.text + "&subject=" + "Web Form Message" + "&message=" + contactMessage_txt.text; And the php code: <?php $contact_name = $_POST['name'];
I want to be able to write a paragraph in a textfield, and then click and hold, or do some similar gesture, and have the entire paragraph selected. I'm then going to drag it (using bitmapdata or whatever) to another textfield.
In order to do this, I need to be able to detect where a given paragraph ends. So I'm trying to do that with the following code, which searches for " " in the text.
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.
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.
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.
<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?
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.
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.
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?
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?
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?
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
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.
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.
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?
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.
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 ?