ActionScript 3.0 :: HtmlText And Empty Lines?
Nov 3, 2011
I am having the most frustrating time with htmlText in TextField.apparently, if you set the htmlText of a TextField, you always get an extra line at the end.Here is what I have found out:Below, a multiline TextField is created and the text property is set. I then grab the htmlText property, set the htmlText to "" and then reapply the htmlText I had just grabbed. This causes a new line to be added to the Textfield:
Actionscript Code:
var tf:TextField = new TextField();tf.width = tf.height = 200;tf.border = true;tf.multiline = true;tf.wordWrap = true;addChild(tf);tf.text = "this is not htmlText";
[code].....
View 2 Replies
Similar Posts:
Oct 6, 2010
I am using a TextArea. I set its htmlText as follows:
textArea.htmlText = '<P ALIGN="CENTER"><FONT FACE="_sans" SIZE="14" COLOR="#FFFF00" LETTERSPACING="0" KERNING="0"></FONT></P>'
The problem is that there are always 2 lines in text area when it runs......when i remove this i get usual one line but then i m not able to set color and all.I want to use textarea, set different colors on it and i dont want 2 lines in that.....
View 6 Replies
Sep 3, 2009
I'm rendering text in a multiline textField as htmlText. I need to put some spacing between each paragraph line, but if a line is long and wraps around, I want the spacing to be normal or narrow. Currently, all lines take on the same spacing regardless of the setting.
View 2 Replies
Oct 6, 2010
I am using a TextArea. I set its htmlText as follows:
textArea.htmlText = '<P ALIGN="CENTER"><FONT FACE="_sans" SIZE="14" COLOR="#FFFF00" LETTERSPACING="0" KERNING="0"></FONT></P>';
The problem is that there are always 2 lines in text area when it runs......when i remove this i get usual one line but then i m not able to set color and all.I want to use textarea, set different colors on it and i dont want 2 lines in that.....
View 2 Replies
May 13, 2011
If you are using Flex 3.5 (not my choice) and you scroll the mousewheel over a Text component with multiple lines of htmlText, it will scroll down 1 (sometimes 2) lines, even [URL] I made sure there is not a blank line below the body of text (it ended after the closing). Notice how the top line is now cut off, and an extra line was added at the bottom.
View 2 Replies
Jun 24, 2009
I have some HTML loaded from an XML document that includes web links (anchor tags). I am using a TextField object to display the text, and am plugging the XML data into the htmlText property of the TextField, and the text is rendering with HTML markup, links are working etc.
The problem I'm seeing is that a new line is created before and after the link, so html like this:
hello world <a href ="#">this is a link</a> and all of this should be on the same line.
is rendered like this (with specific attention paid to the new lines): Does anyone know of a way to prevent these new lines from appearing when using HTML links within a TextField?
View 2 Replies
Feb 16, 2011
For some reason, if you add an image to htmlText, like the following:
myText.htmlText = "<img src='"+dataProvider.bodyImage.getUrl('original')+"' align='left' />" + dataProvider.bodyText;
The image will be successfully added to the htmlText, but it seems to measure the sizes completely wrong. At times, the actual text (dataProvider.bodyText) will have part 'hidden' under the image. At other times, there are anywhere from 1 to 4 lines cut off at the bottom. However, if you select the text and drag your mouse down, you can see the bottom lines. It appears the text is all there, but the mx:Text component is not including the image in the textHeight, so it doesnt resize the componenet to the correct size.
View 1 Replies
Nov 14, 2005
I'm making some kind of rssreader right now... everything goes really well but the only thing is that when i read data from xml i get some empty lines in my text. like this:BAJKONOER - De Europese ruimtevaartorganisatie ESA heeftwoensdagochtend de Europese ruimtesonde Venus Express gelanceerdit just stops after "heeft"... it seems like a normal return... but how do i get it out of my string?
View 3 Replies
Aug 31, 2010
In flex, how to remove empty lines in text area?
View 1 Replies
May 4, 2011
I have a dynamic text box for 3 lines of text. I styled part of the text to be bold and part of it to be regular. When i click on the button to display the text it looks right the first time but if i click on it a second time then all of the text shows up bold instead of just the few lines i assigned the bold tag to.
View 18 Replies
Aug 17, 2011
I have been working on a map viewer based blitting technique. As part of the map I need to draw approximately 50000 lines and performance is currently really poor.
Code: Select allvar movie:Shape = new Shape();
for( ... )
{
movie.graphics.clear();[code].....
View 2 Replies
Nov 15, 2009
My code is on the main timeline.I call a function loop to draw lines between them.The lines are drawing between the right x, y values BUT between those values on the main stage, not those values within the kite.For example, dot1_mc is at x100, y0 inside kite. the line that should go from its center, draws from stage x100, 0.How do I draw the lines inside kite so that they draw between the dots?Heres my code that draws the linesPHP Code:
function loop():void{ lineDrawing.graphics.clear(); var a:Point = new Point(kite_mc.dot1_mc.x, kite_mc.dot1_mc.y); var b:Point = new Point(kite_mc.dot2_mc.x, kite_mc.dot2_mc.y); var c:Point = new
[code].....
View 4 Replies
Mar 3, 2009
I have a list of 99 item (something like a phone book) and I will like to sort them in different method. Part of the 99 item might be empty, so the requirement is to move the empty field behind the sorted data in every sorting behavior, here the code we have so far:
[Code]...
View 1 Replies
Feb 18, 2012
Is there a static property in Action similar to that in the String object in .net to check if a string is empty, that is String.Empty.
View 2 Replies
Jul 21, 2010
I am trying to create a mindmap where the user can drag points about the screen. I have gotten as far as drawing the line via actionscript, and drag+drop the points (defined as movie clips on stage). This is the existing script - I don't know how to get the lines to follow the points. Something to do with ENTER_FRAME or updateAfterEvent?
var line:MovieClip = new MovieClip();
line.graphics.lineStyle(1,1);
line.graphics.moveTo(ptOne.x,ptOne.y);
[code]....
View 1 Replies
Jan 12, 2011
if I use an <img src='images/pic.jpg' /> within a text box that is using classic text, dynamic text as its settings, it has been assigned "render text as html" and has been set to multiline, it works great, that is when my image is in the top of the text area. When I move the image to the end of the scrolling text, it makes my text block larger to accommodate the text instead of making it just scroll more.
View 2 Replies
Feb 29, 2012
context: flashplayer 9, in the same folder as the .fla I have an images folder and inside that the png I wish to display
For the life of me I can't get the img tag to work in a textfield Here is my code, what the bleep am I missing here!! (the other html tags seem to work but not image)
import flash.display.Sprite;
import flash.text.StyleSheet;
import flash.text.TextField;
[Code].....
View 2 Replies
Feb 3, 2009
I have been working with htmlText and everything is loading and appears fine with one minor exception. For some reason there is no space between paragraphs defined by the <p> tag. There will be a line break, but not the extra space between the paragraphs.
View 2 Replies
Apr 26, 2011
I been doing more programming in other languages through the past two flash changes and am now using CS5 (and AS 2.0) for work. Tell me, why doesn't this work:
Code:
this.createTextField("test",1,100,100,500,500);
test.html = true;
test.htmlText = "Hi<br><br>Hi";
No breaks show up - it appears as "HiHi"
I've tried <br /> and <BR> etc. embedFonts && regular.
View 2 Replies
Nov 6, 2008
I (well, a rather angry client) found an oddity I would like to consider a bug in formatting htmlText coming fom XML's toString() method with css.
If somehow an empty tag ends up in XML like <h1></h1>, all of the following text in the field is formatted to the CSS defined props of h1. In the (simplified DocumentClass) code below I have an XML object which has an empty h1-tag after the first sentence of the first paragraph. Placing the XML it in the field renders the text following the empty tag as bold and with the fontsize set for h1.
Strangely, if the html source is initialized as a string and put straight in the textField (see commented code), all formatting is OK.
View 10 Replies
Jul 2, 2009
layout mess up if use css in htmlText.ike if I do
<p><span style='display:inline;color:#6b97fe'>Tel:</span>1234567</p>
there would be a line break after </span>
OR
[code].....
View 2 Replies
Jul 21, 2010
I am having an issue using getCharBoundaries() with htmlText. In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line. getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not). I've read that getCharBoundaries() can be unpredictable; does anyone know of a workaround or why this might be happening?
[Code]...
View 3 Replies
Feb 23, 2011
I have a htmlText Field, and I wanna embed a Movieclip from my library into the text.I've tried everything for about 5 hours, nothing worked, even though the Adobe Help stated that it's possible:src: Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip symbol in the library. This attribute is required all other attributes are optional. External files (JPEG, GIF, PNG, and SWF files) do not show until they are downloaded completely.
View 9 Replies
Apr 6, 2011
I am populating a dynamic text box with some information that comes from an xml.
//fill in the text
infoBox.informationText.htmlText=
"<font size='16' color='#FFFAF0'>"+calledMarkerIndex+[code]....
I am also placing an image in the text box which you can see from the url above.I would like this url to be dynamic just like the other variables that are filling in the text box calledMarkerIndex, calledMarkerDate, calledMarkerDescription.
I have another variable which specifies the url I'd like named calledMarkerContent. I've tried simply chaning the text piece for this but it does not work.
"<img src='calledMarkerContent'/>"+
I feel like maybe I am just making a scripting error. Or maybe I cannot use a dynamic variable in this place.
View 1 Replies
Mar 2, 2010
I have the following setup:wo textfields on the stage with Arial normal and Arial bold, both embedded. I then have another textfield which I am setting like so:tb.htmlText = "Test <b>Test</b>";For some reason, the bold text is not displaying as bold, but as regular weight. I have tried embedding the fonts in the library, using the [Embed] meta tag and even resorted to using CSS to force the fontFamily. Weirdly, I can use Font.enumurateFonts and see both fonts are embedded, but the textfield refused to use the bold version inside the < b > tags.I've been told this is a problem with Flash CS4 on a mac and that it will work on PC. I refuse to believe this is the case, however. Surely Adobe would have fixed this by now?
View 3 Replies
Jul 21, 2010
I am having an issue using getCharBoundaries() with htmlText. In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line. getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not). I've read that getCharBoundaries() can be unpredictable; I've attached the code as a txt file. Update: Even if I try calling getCharBoundaries on a character a few positions before the img tag, so that it's an actual character and not markup, I still get a null value returned.
View 1 Replies
May 30, 2007
problem stated in my title. Attach is my code.
Code:
this.createTextField("myText",this.getNextHighestDepth(),23,72,300,400);
//bgPic._alpha = 25;
var titleS:TextFormat = new TextFormat();
titleS.font = "TradeGothic";
[Code]...
View 3 Replies
Mar 14, 2008
I am trying to create a menu with htmlText. That is, using a textField with several "html links" that call a function (<a href='asfunction:......).I have an array with the menu's options and I use a FOR loop to create each "html link".The problem is that I need the links in one line (at least until the maximum length of the textfield's line is reached..). I was doing this:content.htmlText += "<a href:asfunction...>..." ...but the line breaks. I tried to do:
content.htmlText = content.htmlText + "<a href:asfunction...>..." ...
but it does not work, either. And, if I do:
content.htmlText = content.text + "<a href:asfunction...>..." ...
[code].....
View 1 Replies
Jun 4, 2009
I am reading some CDATA text from an XML file. This text has HTML tags in it.I want to place this text into a dynamically created textfield that has embedFonts set to true. However,when I set this to true, the html formatting doesn't work. Instead, I only see the text without any of the formating.
Now, when I comment out my embendFonts = true statement, the html formatting works, but I loose my linked, library font. (Since the font Futura is on my machine, it stil uses a jaggy (system?) version of it, I'm assuming this would be a problem on a different machine).Is it possible to use embedFonts with htmlText? Am I calling this stuff in the wrong order?
Code:
copyTformat.font = myFont.fontName;
copyTformat.size = 18;
var tf:TextField = new TextField();[code].....
View 4 Replies
Jun 10, 2009
Im my html webpage I'm using this code
Code:
<div id="example"></div>
Code:
<script type="text/javascript">
flashembed("example",
[code]....
and I wonder if i could still get this effect trough htmltext. or does it has to be done in another way
View 4 Replies