ActionScript :: Flex 3 HtmlText Calculates Height Wrong / Strips Span Tags

Jan 11, 2011

I currently have two problems with Flex 3 htmlText.

1) When I am setting my text's htmlText:
myText.htmlText = <html text stored in my mysql database>
It calculates the height way wrong. In most cases, a ton of padding (or whitespace) is added above and below the text. I am not sure what happens, but it calculates the textHeight way higher than normally.

2) If I put <span> tags in my html, it automatically strips them out (instead of just ignoring them). I am using the span tags to be able to dynamically find certain pieces of my text. For instance:
<span class="salutation">Dear,</span> <span class="tag">[First Name]</span>
is inserted in my htmlText, and I use them to parse out the salutation and tag of my variable data.

Any alternative ideas on how to parse out pieces of html? Any way to improve htmlText? How to correctly measure textHeight and/or remove padding?

View 2 Replies


Similar Posts:


ActionScript 3 :: TextArea HtmlText Styling Using <span> Tag?

Oct 27, 2009

According to this webpage, the htmlText property in TextArea can handle CSS text style if using span tag. I want to format multiple tags in my code. Something like:

var tags:TextArea = new TextArea();
tags.htmlText = "<span style='color: rgb(165, 150, -90);
font-size: 0.955882610016677em'>street</span>,[code]............

It only gives me plain text. I was wondering if it is supported in the htmlText property and how do I get around this.

View 2 Replies

Actionscript - Flash Text Engine - TextLine Calculates Height Incorrectly In Some Font?

Nov 14, 2011

I am using Flash Text Engine's TextBlock & TextLine to display text. However, I found that some font make TextLine calculate height incorrectly. Here is my sample code:

package users
{
import flash.display.Sprite;
import flash.display.StageScaleMode;
import flash.events.Event;

[code]....

which means TextLine.textHeight, height, totalHeight, and result from getBounds give the same value, roughly 57.6 pixel So, my question is, how can I get the actual text height?Please don't tell me not to use Swansea. So far, I have tried 5-6 different fonts and only Swansea give me this problem.

View 1 Replies

Actionscript :: Flash - Text Engine - TextLine Calculates Height Incorrectly In Some Font?

Nov 26, 2009

I am using Flash Text Engine's TextBlock & TextLine to display text. However, I found that some font make TextLine calculate height incorrectly. Here is my sample code:

package users
{
import flash.display.Sprite;

[code].....

View 2 Replies

Html :: Rendering HTML Text Containing Advanced HTML Tags Like <strong> - <em> - <span> And Advanced HTML Entities In Flex

Aug 4, 2011

I am designing a web application in Flex 4 and currently facing an issue rendering advanced HTML tags and entities in Flex 4. All I want to do is basically render an HTML text coming to me something like the one given below:-

[Code]....

View 3 Replies

Actionscript 3 :: HtmlText Is Showing Tags

May 20, 2011

I have a textfield created with AS3 as thus: (theDesc is a parameter passed through a function) [code]the problem is the textField is displaying every character. <p><strong> etc.Is there any extra encoding need done on my end?

View 2 Replies

ActionScript 3.0 :: Extract HtmlText To String With Tags?

Feb 15, 2009

I'm working on a textField overflow system for a project at the moment.I cant find a way to return a textField's htmlText complete with the original html tags.The system is used for splitting up a textField above a particular height into two textFields so the side of each other. The system works perfectly with unformatted text, but I cant seem to extract the formatting tags out of the left textField and apply them to the right - all I can get is plain text. (The system uses a StyleSheet by the way - so it is applied to both textFields).I 've tried:

Code:
if (leftField.textHeight > contentHeight) {
//var rightString:String = new String;
var lastLineIndex:int = leftField.getLineIndexAtPoint(10, contentHeight - 5);[code]...........

The commented out code represents the alternative method I've tried (still fails).

View 1 Replies

Html :: Remove Font Tags From HtmlText?

Jan 16, 2012

I'd like to remove the font tags from the htmlText string produced by a TextField leaving the surrounding nodes and any bold etc tags within intact.

Example partial output of htmlText:

<P ALIGN="LEFT"><FONT FACE="ChampagneLimo" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">Lorem Ipsum</FONT></P>

My plan was to avoid trying anything with regex and create an XML object.

However if I create a new XML object containing a root node and then attempt to appendChild the htmlText string so that I have a valid XML object to manipulate I run into a problem with html entities, see example below:

<html>&lt;P ALIGN="LEFT"&gt;&lt;FONT FACE="...

How can the font tags be stripped from htmlText and how can I create a valid XML object from the htmlText string? My plan was to use the XML replace() method

View 1 Replies

AS3 :: Flash - HtmlText Is Rearranging Font Tags By Itself

Feb 27, 2012

I have the following code in AS3:

var str:String = '<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">Lo<FONT COLOR="#0000FF">re<FONT FACE="GG Superscript">m</FONT></FONT><FONT FACE="GG Superscript"> Ip</FONT><FONT COLOR="#990000"><FONT FACE="GG

[Code]....

It seems htmlText is rearranging the html tags. Even though the output is the same, I need the original html back since I am making a text editor and the AFTER htmlText is messing up my tag calculations.

View 1 Replies

ActionScript 2.0 :: Html Tags In HtmlText = Statement?

Mar 11, 2004

A friend is building a blog, with entries placed in a database, pulled out with php, and then passed to flash. It all goes well except for one thing...problems with html. She's using a tutorial from webmonkey and here's all the actionscript, as it originally was created:

Code:
//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field [code]....

the result: everything loaded in the .swf except the title of her entry over the entry itself. There is a bold html tag around that part, she removed it and voila! The title appeared. But now there's another html tag that starts off a line of code, and it's failing. Click on the entries, and nothing loads except the - between the date and title. Here is that section of code:

Code:
for (i=0; i<this.n; i++) {
n.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+" - "+this["date"+i]+"</a></u><br>";
}

She found that by hardcoding a variable defined by the loadArc function, which is pulled in as arcNum, the whole thing works...but of course, can only pull in one entry with the one id number she coded.She also has removed the <u> tags, but the <a href must obviously remain to make her entries clickable.why having html at the front of this statement in the for loop is causing the entire line to fail, and no variable to pass? It's an interesting stumper. To see this in action, here is the page: http:[url].... In that directory you can also find the .fla file and the php results from the database. Tester.html is her second flash movie, also in that directory and completely barebones, and she received the exact same results.

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

Flash :: Supported Html Tags In The HtmlText Parameter Of Components?

Feb 1, 2011

Am working on a flash component that is supposed to display some dynamic text which might include HTML formatting. This text is displayed in a label component (AS3), and i would want it to render correctly, like create a line break when <br> is inserted, but it doesn't!

So am wondering what the supported HTML tags in the label component, and in general all other flash components?

View 1 Replies

ActionScript 3.0 :: Anchor Tags In Htmltext Property Of TextField Causes New Lines In Text?

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

ActionScript 3.0 :: HtmlText Anchor Tags Do Not Support Title Attribute For Tooltips?

Feb 5, 2010

I'm working on a project and I'm encountering an issue with Flash's sporadic support of HTML 1.01 for textboxes that use .htmlText.The "Title" attribute is not supported for showing tooltips when you hover over the link.For instance, in an HTML document, a href='index.html' title='Click Here' will show 'Click Here' in a hovering tooltip box. It doesn't display in Flash.Anyone know of a good work around? I found this page: have yet to get it working with my text. For instance, I have one textbox, and the URL links are set for various words. This means I don't have the coordinates to set my X and Y for the fake hover effect.

View 4 Replies

AS2 :: MovieClip Tracing Wrong Height?

Nov 4, 2011

I have a masked movieclip which contains nothing but static text inserted from the IDE (not programatically).

In the IDE it states this movieclips height to be 332.25, however when I trace the movieclips _height property it returns 327.3.

This is causing my scrollbar code to mess up as it is not scrolling down far enough. It is also not a one off thing, every block of text I make in the IDE exhibits this behaviour.

View 2 Replies

ActionScript 3.0 :: Why Get Wrong Movieclip Width/height

Jul 8, 2010

I've a movieclip in my library ready for export to ActionScript. It's width and height is (723, 614.05), but I tried to put it on stage manually and check. When I get the item from library in ActionScript i get that's it's width and height is (743.65, 626.75). How can that be possible?

View 9 Replies

ActionScript 2.0 :: Stage.height Returning Wrong Value (off By 100)?

Apr 14, 2008

I have an AS2 document that's 590x300. When I do a trace on Stage.height it returns 200. I changed the document to 590x301 and the trance returns 201.

View 3 Replies

ActionScript 3.0 :: Image Can Not Take Height And Width In Htmltext

Jun 20, 2011

Image can not take height and width in htmltext Here my [code]...

View 1 Replies

Html :: IE Displays Flash Movie With Wrong Height Using Swfobject?

Mar 16, 2012

I have a full screen flash movie that loads and displays correctly in firefox and chrome. In IE, however, it displays at 1/3 the width. The embedded code is relatively simple:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

[Code]....

IE respects the height, but I would really like to use 100% height. What could I be doing wrong?

Tested in IE 8, Windows XP, Flash Player 11, SWFObject v2.0

View 2 Replies

ActionScript 2.0 :: Loadmovie/loadclip On Attached MC Giving Wrong Height And Width

Nov 14, 2006

I got this frame i created and gave it a linkage name of : "myframe"

myframe has a picloader mc and a picmask mc..

I loop through attaching "myframe" at proper depths 12 times and once it is attached, i use loadmovie or loadclip to attach an image to myframe.picloader and enforce the mask onthe pic.

once I load the image, i do some tweening effects in AS but the width and height is no longer correct.

myframe is supposed to be 130 x 100 but now im getting 621 by 400.2.

View 2 Replies

Flex :: Making Image Span Across Several Components?

Aug 11, 2009

Recently I've found a nice on-line diagramming tool - LovelyCharts. I like the way UI is designed - you can view screenshot here. I wonder how to make an image that span across multiple components, like the LovelyCharts logo in the upper right corner of the screenshot.

View 2 Replies

Flex :: Multiline - Linkbutton Text To Span 2 Lines

Feb 23, 2010

is there a way to span the text of a link button to 2 lines? so instead of "Save Page" to be in one line only, I want it to be in 2 lines.

View 1 Replies

AS3 :: Flash Strips Out 1's And F's In TextField

May 23, 2010

The case: I've made a dynamic textField which imports html-text form a .txt file. The strange thing is, that all 1's and F's get stripped out.

What i tried:

- I tried to trace() the imported string, that worked, the 1's and F's are still there (but in the console ofcourse, not in the textfield). - I tried to replace the 1's and F's with ascii codes, but even then the 1's and F's get stripped out. The ascii codes do appear when i trace the string.

Code:
code:
var url:String = "inhoud.txt";
var loadit:URLLoader = new URLLoader();

[Code].....

View 2 Replies

AS3 :: Flash Strips Out 1's And F's In TextField?

Oct 27, 2010

The case: I've made a dynamic textField which imports html-text form a .txt file. The strange thing is, that all 1's and F's get stripped out.

What i tried:

- I tried to trace() the imported string, that worked, the 1's and F's are still there (but in the console ofcourse, not in the textfield).

- I tried to replace the 1's and F's with ascii codes, but even then the 1's and F's get stripped out. The ascii codes do appear when i trace the string.

code:
var url:String = "inhoud.txt";
var loadit:URLLoader = new URLLoader();

[code]....

View 3 Replies

Flash CS5 :: Dynamic Text Field Strips Out Certain Letters

May 3, 2011

Using CS5, and certain letters simply won't show up in my dynamic text field. Not even a blank shows up, they just get stripped out. 'g' and 'v' are two of the letters, so the string 'v testing' shows up on the stage as 'testin'.

It doesn't seem to matter if I start with the string already in there, or add it dynamically. Here are the settings, but they don't really seem to matter either, I've experimented:

Classic Text
Dynamic Text
Ariel
Regular
Anti-alias for animation
Single line

View 2 Replies

Bind A Flex Component's Height To Height Of Browser Window?

Nov 10, 2009

I want to constrain the height of a flex component to the height of the browser viewport.

The component's children are populated from a database table using a repeater, and are basic checkboxes. There are enough of them that the flex app ends up being about twice the height of the screen, which means some of the rest of the layout goes crappy on me. How can I force the component that contains these to limit itself to the size of the viewport?

View 4 Replies

Flex :: Setting Spark List Height To Its Content Height?

Apr 1, 2010

How to set a Spark List height to the height of its content?Tried this:

var lastRow:IVisualElement =
myList.dataGroup.getElementAt(myList.dataGroup.numElements - 1);
myList.height = lastRow.y + lastRow.height;

It works in case of a single item, but lastRow is null in case of more items.

View 5 Replies

Flex :: Layout - Set Height Of Accordion To Height Of Tallest Child

Apr 5, 2010

By default the height of an Flex Accordion container is the height of the initially selected child. I'd like to be able to set the height to the tallest child so that no resizing or scrolling is necessary when other children are selected. I do not want to use the resizeToContent property. I want the size of the container to stay constant no matter what child is selected.

My current thought is to extend the accordion class setting the creation policy to "all" and then override the measure function to loop through all the children and find the tallest one and use that for the height. This seems a little kludgy though, so I'd like to know if there is a better approach. Ultimately my question is: is there a way to set the size of an accordion container such that the container never resizes and scoll bars are never necessary to display any of the children?

View 1 Replies

Flex :: Make Height Of SWF == Height Of Content?

May 26, 2009

I am going to embed a Flex app on an html page. The html page is already going to have a scroll bar to scroll up and down. The contents of the flex app are very dynamic, and I don't want to have an extra scroll bar when there is already one. So is there a way to make the height of the swf match the height of the contents of the swf?

View 2 Replies

ActionScript 3.0 :: Converting HTML Tags To XML Well-Formed Tags?

Sep 10, 2009

I have HTML file, I changed its extension to .XML.I'd like to convert HTML tags to valid XML document using AS3.

View 6 Replies







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