Flash :: TLF - Flowing Text Through Multiple Containers And Line Breaks?

Nov 20, 2010

I'm using TLF to lay out a dictionary entry. It's working fairly well, but I need finer grained control of layout than I'm able to achieve through setting style properties on FlowElements, primarily for horizontal spacing and setting padding on SpanElements independently of their parents.

The solution that seems most promising is separating the various elements of the entry into separate containers and flowing the text through them by progressively adding new containers and ContainerControllers for each new element with size set to their content bounds so that the text will flow into each new container.

This ALMOST works, but the text will only flow correctly into the next container if an extra line break is inserted between the two sections of text that should go to different containers. Without the line break, the containers are sized correctly, but no text displays.

In these examples I've added borders to the container sprites so you can see where they're being drawn. Aside from the line break, the text is exactly the same. The syllable field is a SpanElement inside a ParagraphElement. The pronunciation label and text are separate SpanElements inside another ParagraphElement.

[Code]...

As you can see, the pronunciation doesn't show unless a line break is added after the text, but the alignment is then off. No combination of line breaks seems to align them correctly.

Any ideas? Are these bugs in TLF? Should I try a different method? I would really like to have all the text selectable as one unit, and I love the better rendering and control that TLF offers, but I also need the layout flexibility. I suppose it's possible that I could hack something together like this with line breaks and positioning offsets, but it certainly wouldn't be pretty (or maintainable).

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Load A Text File Using Line Breaks As A Delimeter Rather Than Having A &var= At The Beginning Of Each Line?

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

ActionScript 3.0 :: Flash TLF Text - Eventlistener And Line Breaks

Jun 14, 2011

I just started using TLF text and it's interesting. I have this issue however. I made an swf to demonstrate the problem and you can try it here: [URL] But this is the problem: I have an input textfield (type input) and output textfield (dynamic not selectable) and eventlisteners on the input fields. It seems like the TLF does not register the enter-key. Try it for yourself via the link above.My code is:

[Code]...

View 1 Replies

ActionScript 3.0 :: Adding Line Breaks After The Line Of Text

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

ActionScript 3.0 :: Split A Large Text File Into An Array At Line Breaks So One Array Element = One Line?

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

ActionScript 2.0 :: Make Line Breaks When Load Text Into A Dynamic Text Box?

May 11, 2003

Is there any way to make line breaks when you load text into a dynamic text box, other than using html? And if not, could someone give me an example of how to do it using html?

View 12 Replies

ActionScript 1/2 :: Line Breaks In Dynamic Text

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

Enter Text Field And Line Breaks?

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

ActionScript 2.0 :: Split Text At The Line Breaks?

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

ActionScript 3.0 :: Add Line Breaks To Text Fields?

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

ActionScript 3.0 :: Stylesheet Removing Line Breaks In Text?

Jul 28, 2010

I am working on a simple textfield(or so i initially thought simple.) that consists of a scroll bar, some dynamically loaded text with a small amount of css styling the hyperlink. There are no initial errors the text loads, the style is applied successfully,scroll bar works BUT the text is no longer organised as all the breaks between the paragraph are gone and the text is squashed together in one block.

I've put my code below.the css is labeled code as there is no cSS tag on this forum

ActionScript Code:
import flash.net.URLLoader;
import fl.controls.UIScrollBar;
import flash.events.Event;

[Code].....

View 0 Replies

ActionScript 2.0 :: Line Breaks In Dynamic Text Field?

Feb 29, 2004

I basically want to be able to put double spaces between my paragraphs.

This is how my text field is set [AS]set (myTextField, "A bunch of text here");[/AS]

View 5 Replies

ActionScript 3.0 :: HTML Text And Embedded Fonts - Line Breaks Ignored

Aug 20, 2008

When using a StyleSheet with html text in a dynamic textfield with embedded fonts line breaks are ignored. It is as if TextField.condenseWhite is being set to true. Essentially the <p> tags are being treated as a <br/> tag. If I don't embed fonts it works fine. Another weird thing is if I add an empty paragraph <p></p> between the first two paragraphs it makes any subsequent paragraph behave correctly.

E.g.
<p>first paragraph text here</p>
<p>second paragraph text here</p>
<p>third paragraph text here</p>
Displays as if there are <br/> between each one.

But
<p>first paragraph text here</p>
<p></p>
<p>second paragraph text here</p>
<p>third paragraph text here</p>
behaves correctly even for the third paragraph.

Here is the code I am working with (using XML as I am dynamically populating the textfield from XML). After reading [URL] I tried the same experiment using a TF drawn in the IDE, the results for each, even though the TextFields are essentially the same are totally different. Updated Code accordingly - just need a TF on stage, called "ideTextField" with font 'Arial'.

View 1 Replies

ActionScript 2.0 :: HTML Text / Embed Fonts Line-breaks Ignored?

Jan 25, 2010

I'm having a problem with my imported HTML text - basically when I switch on 'Embed fonts' for a text field, Flash will only ever render one line break, regardless of how many </p> <br /> or whatever other type of line-breaking tag you can imagine are present.What this means is that all my paragraphs are squashed up into one, with no double line-break after the closing </p> tag, as you'd expect.I've used html text with css before and normally experience the opposite problem, whereby whitespace linebreaks in the imported text are rendered, but this problem is a new one on me.

View 1 Replies

ActionScript 2.0 :: Importing XML - Strip Unintentional Line Breaks From Text?

Jan 29, 2010

I know that I've seen a few threads about this, but I'm not finding what I'm looking for. I've got an AS2 flash site using XML to import the text, then parsing it. I have a function that gets the text, then applies styles (css) to it. I'm wondering if there is an easy way to strip the unintentional line breaks at the same time, within the same function? Here is my get text function:

[Code]...

View 1 Replies

ActionScript 2.0 :: Load A Text File Using Line Breaks As A Delimeter?

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

Flex :: Remove Line Breaks From Pasted Text In Spark TextArea?

May 5, 2011

I'm trying to remove all line breaks from the text that is pasted into the Spark TextArea.

I have:
<s:TextArea id="inputSearchQuery"
width="100%" height="22"

[code].....

View 1 Replies

Actionscript 2.0 :: Getting Mixed Results With The Text Using The LoadVars Method Mainly With Line Breaks?

Jul 13, 2009

Just completed this project http:[url].... however I'm getting mixed results with the text using the LoadVars method mainly with line breaks. On the live and store pages there is a text link within the copy, any idea of how I can format that as xml tags as I'm finding that easier to control, the rest of the site mainly uses xml text just these two pages are using external .txt docs because of the urls. Surely there is a way?

View 1 Replies

ActionScript 2.0 :: Load Data From XML Into Multiple Containers In Flash?

Mar 15, 2011

I have an XML file with 1 parent node that has 1 child node inside it. The parent node is straight forward. It only has one attribute.

The child node has 3 attributes in it - Title, Photo, URL

I want my Flash file to have 3 containers - 2 Text list containers and 1 image holder. The first text container will load all of the Names of parent node. The second text container will load all of the Title of the child node.

The 3rd container will be a MC holder that will load the Photo and will link it to the URL specified in child node.

How do I script my Flash file?

Right now, my script is as follows and it successfully loads the name from parent node in one of the containers. I'm confused with other two!

Code:
function onXmlLoaded(success:Boolean) {
if (success) {
// make a handle to the root node in the xml

[Code]....

View 3 Replies

ActionScript 3.0 :: Line Breaks And Paragraphs In Flash?

Jul 6, 2009

I have a message that is sent by mail using Flash and PHP.

The Message is build from 5 textfields, each with one paragraph.

I need to send this message with online between each paragraph. The problem is that I can't add lines to code using code.

how can I do this inside flash?

(I don't want to use HTML, the message will be sent using plain text)

View 1 Replies

Actionscript 3 :: Flash - Fix Line Breaks In HtmlText That Uses <b> Tags In The Xml?

Jun 10, 2010

I'm importing text in from an xml file and i'm using htmlText to try to keep some styling with tags. I have both the regular and bold face font embedded, and the bolding works fine. The problem is that it ads spaces around the words in bold like a paragraph indent and then makes a line-break after them. What's going on, is there a way to fix?

fromxmlText.htmlText = theXML.contenttext;

If I pull the text in from a txt file it will work fine, but taking it out of an xml file causing funky formatting.

View 4 Replies

Php :: Maintaining Line Breaks In Flash TLF Editable Field?

Oct 14, 2011

I have a TLF editable field in a(n) swf file. Text entered there gets sent to a php page where everything is processed. I had the behavior set for multiline, but just realized that if someone hits return and keeps typing, no break is displayed (not even a space). I've tried using nl2br() in the php when it grabs the POST variable from flash, but that doesn't work. I don't know how flash handles the carriage return, so I don't know how to handle it on the php side either.

View 1 Replies

ActionScript 2.0 :: Flash To PHP Email Line Breaks Deleted

Feb 21, 2008

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;

[Code].....

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?

View 3 Replies

ActionScript 3.0 :: Line Breaks In A "Input Text Field"?

Jan 8, 2010

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'];

[code].....

View 4 Replies

Flash :: Sifr 3 Barebones Test - Unusual Line Breaks?

Nov 13, 2009

I want to use a non-standard font on the web in a various combinations of font-color and font-size without having to assign individual configs for each. So far sIFR seems to pick up font-size no problem. but not font color, so I am working on a work around.

The problem I am running into: sIFR is breaking text to the next line without a linebreak <BR> being present.

[Code]...

For the sake of the project I am working on, it looks like setting the standard to block level elements only with font-sizes of 18px and above will be the route taken to keep from holding it up further, but I still have personal interest and would like to pursue understanding sIFR and the line breaking further.

I am new to Stack Overflow and am concerned this may be an 'extended discussion' which the FAQ says is beyond the scope of this site.

View 2 Replies

ActionScript 3.0 :: Flowing An Instance In Html Text?

Mar 18, 2011

I want to flow some MovieClips with special functionality inside a html text area. I get them to appear as desired like this:

HTML Code:
<img src="SpecialMovieClip"/>

The problem is how can I have each instance of "SpecialMovieClip" have unique attributes? I imagine html like this:

HTML Code:
<img src="SpecialMovieClip" data="something"/>

And then being able to read the "data" attribute from inside the SpecialMovieClip class.

View 0 Replies

ActionScript 2.0 :: Loading MovieClips On KeyPress To Multiple Containers

Nov 7, 2005

[URL]. I'm trying to load multiple swf's on a key-press. Loading to one mc is not a problem, but when I try to define multiple containers from multiple sources it doesn't work. This is an XML example:
<menu><item name="item1" >
<sub name="item2" >
<subsub name="item3" action="item3.swf" texte="text.swf"/>
function on menu mc:
function executeAction(action, texte) {
trace(action);
trace(texte);
loadMovie( action, _root.content);
loadMovie( texte, _root.texte);
}

View 2 Replies

ActionScript 3.0 :: Line Breaks In IE?

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

ActionScript 2.0 :: Css Line Breaks?

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

ActionScript 2.0 :: Have Some Line Breaks In XML?

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







Copyrights 2005-15 www.BigResource.com, All rights reserved