Render text to htmlText

Hello, I have this weird problem that i can't seem to fix.
I have an input textfield on my stage with the instance
input_txt
I am loading a variable from an textfile with
var my_message1:String;
function dataOnLoad_install(evt:Event){
my_message1 = (evt.target.data.myMessage1).toString();
trace("loaded message "+my_message1);
When i trace my_message1 the outputs returns:
<TEXTFORMAT LEADING=\"2\"><P
ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"12\"
COLOR=\"#333333\" LETTERSPACING=\"0\"
KERNING=\"0\"><B>abcdefg
aaa</B></FONT></P></TEXTFORMAT>
So that seems to go well, but when i want to set the
textfield input_txt to this string value nothing is displayed.
input_txt.htmlText = my_message1;
I really don't get it, because when i put the output of the
trace directly in the textfield it works fine.
input_txt.htmlText = '<TEXTFORMAT LEADING=\"2\"><P
ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"12\"
COLOR=\"#333333\" LETTERSPACING=\"0\"
KERNING=\"0\"><B>abcdefg
aaa</B></FONT></P></TEXTFORMAT>' ;
So, how is this possible? I tried almost everyting... does
anybody has an idea on what the problem
could be?
Regards

Thanks everyone, but i think there is a 'bug' in rendering
this html textformat into a textfield.
I tried to isolate the problem. And if you run this, you will
be in for a surprise :(
If you uncomment the line
//my_message = '<TEXTFORMAT LEADING=\"2\"><P
ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"12\"
COLOR=\"#333333\" LETTERSPACING=\"0\"
KERNING=\"0\"><B>abcdefg
aaa</B></FONT></P></TEXTFORMAT>';
You will see the text "abcdefg aaa" without a problem.
Hi Kglad, I think i am sure that i don't set the value before
it's loaded because
if you replace this line
message_txt.htmlText = my_message;
to this
message_txt.htmlText = escape(my_message);
You will see unformatted text in the textfield. Also if you
change it to message_txt.text = my_message;
It goes wrong when it's loaded ...perhaps we can't see in the
trace something??
Is there a fix for this? And should this
'bug' be reported?
Try these line of code. Place an dynamic or input text and
call it's instance name message_txt

Similar Messages

  • Render Text as HTML

    Has anyone else had trouble with the Render Text As HTML function in CS4? I want to use two different fonts in the one textfield. Looks fine in Flash but when I export the swf, only the first font is used.

    Yeah this has happened to me a few times since I started this thread a few weeks back.
    Say for example, I have a paragraph of black text set in Helvetica Neue 55 Roman on the stage. I change the colour of some words to red and change some other words to Helvetica Neue 75 Bold. When I export the swf, the words that are set in red are still visible but those words set in 75 Bold are MISSING COMPLETELY, not just changed back to 55 Roman. Back in the Flash file if I select the text which is set in 75 Bold and look to the properties panel it tells me that the text is set in 27 Ultra Light Condensed even though by looking at the stage I can see that the text is clearly set in 75 Bold. What the duck?!?
    I'm thinking it's another CS4 bug. They fixed a few bugs in the update back in May but this particular issue hasn't been resolved I guess.
    Prabug, it sounds like you are loading your text dynamically and applying CSS styles. Is that correct?

  • "Render text as HTML" feature broken in Flash CS6

    ******BUG******
    Concise problem statement:
    Classic text field set to render in html mode does not display the left margin correctly for the 2nd and subsequent paragraphs once you exit edit mode on the text field.  Instead, all paragraphs render as though they have the same left margin as the first paragraph.  It displays incorrectly at runtime as well.
    Steps to reproduce bug:
    1. Create a "classic text" mode text field as dynamic text with "render as html" button checked and set to multiline.
    2. Enter a title line, press enter, then create a second paragraph, press enter, then create a 3rd paragraph.
    3. Select the 2nd paragraph and increase the left margin.
    4. Select the 3rd paragraph and set the left margin to something different than the 1st or 2nd paragraph.
    5. Deselect the text field to finish editing.
    Results:
    While editing the text field, the left margins on the second and third paragraphs are displayed correctly with independent values, but once you finish editing it and deselect the text field, the entire text field displays as though all paragraphs have the same margin as the first paragraph.  If you resume editing, the indentation re-appears, so it's not lost, but it's not being displayed correctly unless you're in edit mode for the text field.  It also displays incorrectly at runtime in the final SWF.
    Expected results:
    The indentation should be visible regardless of whether I'm in edit mode for the text field.
    This feature (html mode display of text) is unusable at design time or runtime, because the text field does not display correctly unless you're actively editing it.
    FYI: Things like different colors, fonts, etc. seem to be preserved, but anything related to paragraph formatting is lost.  If I trace the htmlText at runtime, it's clear that none of the unique paragraph formatting was preserved from the editor, because all paragraphs seem to have taken on the same textformat attributes as the first paragraph.

    If I was going to do everything in ActionScript, I wouldn't have bought Flash Professional, I'd have just compiled with the flex compiler for free.  99% of my stuff is pure AS3 anyway, with a lot of drawing commands and even embedded objects like pixel shader binaries.  It's just annoying that I can't use the Flash Professional visual designer as intended to perform WYSIWYG layout, because paragraph formatting is broken.  It's not copying the values from the UI into the final HTML for the text field.  I find like 3 new serious bugs every single day I use Flash, and for the amount of time I spend debugging the IDE and filing bug reports, Adobe should be paying me to use their product, not the other way around.
    The only real "workaround" to perform proper paragraph formatting in the visual editor is to use the TLF, which should have been integrated into the Flash Player to begin with instead of existing as an RSL that has to be specially referenced by any project that uses it, cluttering the external library reference list.  Someone needs to build a Flash IDE inside Flash that specifically generates classes for library symbols with all the necessary code in the constructor to build the symbol, so it runs online and is truely WYSIWYG (perhaps something like Gliffy: http://www.gliffy.com/gliffy/#templateId=blank&signup=1 (this link bypasses login)
    I still can't get a static text field to look the same as the dynamic one.  The closest I can get it match is by setting render as HTML on and setting the field to multiline, but characters still shift slightly.  TLF text, on the other hand, has perfect consistancy, and edit mode lines up perfectly with non-edit mode, which is exactly how it should have operated from the beginning (like back in MX days).
    Then of course there is this problem: http://www.stevensacks.net/2010/05/28/flash-cs5-tlf-engine-causes-errors-with-loaded-swfs/

  • Render text item with procedure call

    I have made several custom item types with custom attributes, and I use a procedure calls to render them in my region.
    For example, the pl/sql call from the item can look like: portal.write_text and I use p_id and p_text as attribute parameters.
    When I render the Text attribute it shows with no new lines (no <p>) although it is written with it in the item wizard.
    How can I render the text attribute exactly as it supposed to be? (with <p>'s)
    /Malin

    Even simpler:
    procedure showTextItem (p_itemid IN INTEGER, p_siteid IN INTEGER, p_language IN VARCHAR2) is
       theText varchar2(32767);
       begin
          select i.text
             into theText
             from portal.wwsbr_all_items i
             where i.id = p_itemid
             and   i.caid = p_siteid
             and   i.is_current_version = 1
             and   i.active = 1
             and    (i.language = p_language
                        or ( exists -- a row for the item in the page group default language            
                              (select pg.id             
                               from  wwsbr_all_content_areas pg             
                               where pg.id = i.caid             
                               and   pg.default_language = i.language             
                             and not exists -- a row for the item in the current language            
                              (select i2.id             
                               from  wwsbr_all_items i2             
                               where i2.id = i.id             
                               and   i2.language = p_language
                               and   i2.is_current_version = 1
                               and   i2.active = 1             
          htp.p(theText);
       exception
          when others then htp.p(sqlerrm);
       end;Note the conditions on language, active status, and current version - you should include these conditions
    whenever you query from wwsbr_all_items.
    Please refer to the content repository view documentation in the PDK.
    Regards,
    Jerry
    PortalPM

  • Pages 5.1 (1769) is failing to render text blocks on printing as .pdf, what can I do?

    Sometimes all blocks are rendered properly and sometimes text blocks and images are missing. It appears to be random. It's happening when I open a document and when I print documents out to be saved as a pdf.
    Has anyone had this problem? How is it solved?
    Thanks,
    George

    The fact that renderings for print are very different from page display would seem serious. Print is unreliable. Blocks appearing on screen are moved or missing when printed or the document is saved,  closed, and then reopened. This occurs at random. Is there anywhere in the Apple world to log a problem? Are others experiencing similar problems? Arrrrrrrgh! I have little enough hair already.

  • How to render text containing enumeration tag in a list form

    We have text definition that include enumeration tag that are to publish as a enumeration
    <text>this is an enumeration of color :
    <enum>
    <enumItem>blue
    <enum>
    <enumItem>dark blue</enumItem>
    <enumItem>ligh blue</enumItem>
    </enum>
    </enumItem>
    <enumItem>red</enumItem>
    </enum> for the blue and the red
    <text>
    has to be rendered as :
    This is a enumeration of color :
    1. blue
    1.1 dark blue
    1.2 light blue
    2. red
    for the blue and the red
    The enumeration formatting is to be done in the template
    Is it possible with xml publisher template builder ? is it described somewhere ?

    Hi Tim
    Thank you for your answer but after i checked out again these chapters i didn't find the needed info.

  • Acrobat does not render text of manually created minimal PDF

    I have made a minimal PDF, but the text string is not rendered when opened in Acrobat. (PDF code, without newlines, here: %PDF-1.1 1 0 obj <</Type /Catalog /Pages 2 0 R>> endobj 2 0 obj <</Type /Pages /Kids [3 0 R] /Count 1 /MediaBox [0 0 300 100]>> endobj 3 0 obj <</Type /Page /Parent 2 0 R /Resources <</Font << /F1 <</Type /Font /Subtype /Type1 /BaseFont /Times-Roman>>>>>> /Contents 4 0 R>> endobj 4 0 obj <</Length 65>> stream BT /F1 18 Tf 20 35 Td (Konvertering till PDF misslyckades!) Tj ET endstream endobj xref 0 5 0000000000 65535 f 0000000009 00000 n 0000000055 00000 n 0000000134 00000 n 0000000280 00000 n trailer <</Root 1 0 R /Size 5>> startxref 392 %%EOF)

    Our styles are obviously incompatible. However, I feel obliged to comment for the benefit of people who may find this thread in future.
    It is quite wrong to say offset data is ignored. This is an extremely damaging policy to follow. Offset data and stream lengths are extremely important because PDF viewers are expected to use it to find PDF. Imagine reading a file sized in gigabytes - it is the only efficient way to find data.
    Now, it is common, especially for beginners, to see that it is not important. This is because many PDF readers are designed to detect bad files and repair them. However
    * not all readers will repair
    * readers repair in different ways (e.g. some will only correct errors that could reasonably have happened from line end transformation
    * files which pass initial tests (files which are nearly right) may not be repaired at all, leading to subtle and difficult to detect errors. This especially includes files with superficially correct xref tables and startxref but wrong offsets or streams.
    Therefore I make it an absolute policy never to examine the text of PDFs, only to examine actual files. My experience, which you can choose to learn from or not, is that more than half of beginner problems arise from bad xref tables, offsets or stream lengths.
    However, you clearly don't want my advice; I will confine myself to correcting factual errors in your post for the benefit of others. Have a nice day!

  • Text styling htmlText

    Hi all,
    i'm developping with Flex 2, i would use the Component
    Text, which accepts HTML. I have no problem with applying
    "font color", but i would like to apply a
    span class with a
    css file.
    After searching, i've seen some solutions for
    TextArea but they don't work with
    Text !
    Is their any solutions ?
    Thanks for your help,
    Anthony

    I just apply some css to my form, check this article.
    http://blog.kevinhoyt.org/2006/06/01/css-positioning-with-flex-2/
    But it looks like only some styles apply.
    Rgds
    JFB
    "Anthony(France)" <[email protected]> wrote
    in message
    news:fc8qsd$jne$[email protected]..
    > Hi all,
    >
    > i'm developping with Flex 2, i would use the Component
    Text, which
    > accepts HTML. I have no problem with applying "font
    color", but i would
    > like to
    > apply a
    span class with a
    css file.
    > After searching, i've seen some solutions for
    TextArea but they
    > don't
    > work with
    Text !
    >
    > Is their any solutions ?
    > Thanks for your help,
    > Anthony
    >

  • How do you render text for a credit?

    i'm trying to add an opening credit and i got all the way the sample text and changed that to what i wanted but when i clicked and dragged it to the time line it wouldn't show in the canvas it just said render

    Apple-R??
    CaptM

  • Problem – loading HTMLtext from a text file

    Problem – loading HTMLtext from a text file
    Hi, I have a dynamic text set up to render text as HTML and I
    am loading the text into the text object by using the code below.
    var loadText:LoadVars = new LoadVars();
    loadText.load("Nyheter.txt");
    loadText.onLoad = function(success){
    if(success){
    Nyheter_txt.htmlText = this.VariabelTekst;
    The textfile looks like:
    VariabelTekst=<p align
    ="Right">(13.11.2006)</p><p><b><font
    size="12">This is the tittle</b></p><p>Here
    comes the text</p>
    It works almost fine but the first problem is that the
    paragraph text in the textfile should be written in Norwegian. This
    involves some Nordic characters. By default these characters are
    just shown as small square in the text control when running the
    flash file. If I try to enter these characters in the textbox
    “Include these characters” within the dialog for
    embedding, the text within the bold tag of the text file is not
    shown when the text is rendered. It looks as if it effect the HTML
    rendering of the text. The Nordic characters are still not showing
    but instead the small square placeholders for the characters are
    gone.
    Am I doing it wrong, or is there a work around for solving
    this problem?
    Any ideas?
    TIRislaa

    Problem – loading HTMLtext from a text file
    Hi, I have a dynamic text set up to render text as HTML and I
    am loading the text into the text object by using the code below.
    var loadText:LoadVars = new LoadVars();
    loadText.load("Nyheter.txt");
    loadText.onLoad = function(success){
    if(success){
    Nyheter_txt.htmlText = this.VariabelTekst;
    The textfile looks like:
    VariabelTekst=<p align
    ="Right">(13.11.2006)</p><p><b><font
    size="12">This is the tittle</b></p><p>Here
    comes the text</p>
    It works almost fine but the first problem is that the
    paragraph text in the textfile should be written in Norwegian. This
    involves some Nordic characters. By default these characters are
    just shown as small square in the text control when running the
    flash file. If I try to enter these characters in the textbox
    “Include these characters” within the dialog for
    embedding, the text within the bold tag of the text file is not
    shown when the text is rendered. It looks as if it effect the HTML
    rendering of the text. The Nordic characters are still not showing
    but instead the small square placeholders for the characters are
    gone.
    Am I doing it wrong, or is there a work around for solving
    this problem?
    Any ideas?
    TIRislaa

  • How to get text's position in htmlText

    Dear All:
    I include some text into htmlText from a xml file and the
    text has serval paragraph,I want to add
    one grey rectangle background to every paragraph and need to
    get coordinate of ever paragraph.
    who can tell me how to realize it ?I'll appreciate for any
    reply.
    Best Regards
    Jacky

    Dear All:
    I include some text into htmlText from a xml file and the
    text has serval paragraph,I want to add
    one grey rectangle background to every paragraph and need to
    get coordinate of ever paragraph.
    who can tell me how to realize it ?I'll appreciate for any
    reply.
    Best Regards
    Jacky

  • Custom render for some format of text

    Hi
     I would like to write add in for word, to render text custom format.
    For example, if the word document contains some key words, I will have to make/display
    highlighted or CLICKABLE
    without changing the word contents. Basically I wanted to change the word (override render engine), I'm new to office development, can someone shade some light on this.
    When the user open the document, I want highlight the pre-defind texts without changing the content. User should not be prompted for save when he closes the document. 
    -Bala
    Balamurali C

    Hi Bala,
    Base on my test, I find for the Find and Replacement method, it needs to change
    HighlightColorIndex value and the current document will be changed. (it will prompts the save window)
    I don’t find a way to highlight word without change, I think you could highlight the word in
    Open event and clear highlight in
    Close event.
    To deal with the save prompt window, you could set
    Saved property to true.
    There are some links that can help you:
    # Replacement.Highlight Property
    https://msdn.microsoft.com/en-us/library/office/ff195308.aspx
    # How Can I Search for and Highlight Words in a Microsoft Word Document?
    http://blogs.technet.com/b/heyscriptingguy/archive/2006/03/21/how-can-i-search-for-and-highlight-words-in-a-microsoft-word-document.aspx
    # Create Add-ins and Customizations for Office by using Visual Studio
    https://msdn.microsoft.com/en-us/library/jj620922.aspx
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • [svn] 4634: First part of glue code for allowing Halo components to use the new Text Layout Framework , in order to get functionality such as bidirectional text.

    Revision: 4634
    Author:   [email protected]
    Date:     2009-01-22 17:38:56 -0800 (Thu, 22 Jan 2009)
    Log Message:
    First part of glue code for allowing Halo components to use the new Text Layout Framework, in order to get functionality such as bidirectional text.
    Background:
    TLF is making this possible by implementing a TLFTextField class. It is a Sprite that uses TLF to implement the same properties and methods as the legacy TextField class in the Player. Thanks to the createInFontContext() bottleneck method in UIComponent, it can be used by a properly-written Halo component (such as those in Flex 3) without any modifications to the component.
    Note: Text should render similarly -- but is unlikely to render identically -- when a component uses TLFTextField vs. TextField. The width and height may be different, affecting layout; text could wrap differently; etc. This is a fact-of-life based on the fact that TLF/FTE and TextField are completely different text engines.
    Whether a Halo component uses TLF or not to render text will be determined in Flex 4 by a new style, textFieldClass. (Gumbo components always use TLF.)
    TLFTextField is currently only partially implemented. It does not yet support scrolling, selection, editing, multiple formats, or htmlText. Therefore it can only be used for simple display text, such as a Button label.
    Details:
    The TextStyles.as bucket 'o text styles now includes a non-inheriting textFieldClass style. It can be set to either mx.core.UITextField or mx.core.UITLFTextField. These are the Flex framework's wrapper classes around the lower-level classes flash.text.TextField (in the Player) and its TLF-based workalike, flashx.textLayout.controls.TLFTextField.
    The global selector in defaults.css currently sets it to mx.core.UITextField using a ClassReference directive. For the time being, all Halo components will continue to use the "real" TextField.
    The new UITLFTextField is a copy of UITextField, except that it extends TLFTextField instead of TextField. This class has been added to FrameworkClasses.as because no classes in framework.swc have a dependency on it. It will get soft-linked into applcations via the textFieldClass style.
    The TLFTextField class currently lives in a fourth TLF SWC, textLayout_textField.swc. This SWC has been added to various build scripts. The external-library-path for building framework.swc now includes all four TLF SWCs, because UITLFTextField can't be compiled and linked without them. However, since they are external they aren't linked into framework.swc.
    Properly-written Halo UIComponents access their text fields only through the IUITextField interface, and they create text fields like this:
    textField = IUITextField(createInFontContext(UITextField));
    (The reason for using createInFontContext() is to support embedded fonts that are embedded in a different SWF.)
    The createInFontContext() method of UIComponent has been modified to use the textFieldClass style to determine whether to create a UITextField or a UITLFTextField.
    With these changes, you can now write code like
    to get two Buttons, the first of which uses UITextField (because this is the value of textFieldClass in the global selector) and the second of which uses UITLFTextField. They look very similar, which is good!
    Currently, both Buttons are being measured by using an offscreen TextField. A subsequent checkin will make components rendering using UITLFTextField measure themselves using an offscreen TLFTextField so that measurement and rendering are consistent.
    QE Notes: None
    Doc Notes: None
    Bugs: None
    Reviewer: Deepa
    Modified Paths:
        flex/sdk/trunk/asdoc/build.xml
        flex/sdk/trunk/build.xml
        flex/sdk/trunk/frameworks/projects/framework/build.xml
        flex/sdk/trunk/frameworks/projects/framework/defaults.css
        flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/TextStyles.as
    Added Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITLFTextField.as

    Many of your points are totally legitimate.
    This one, however, is not:
    …To put it another way, the design of the site seems to be geared much more towards its regular users than those the site is supposedly trying to "help"…
    The design and management of the forums for more than five years have driven literally dozens of the most valuable contributors and "regulars" away from the forums—permanently.
    The only conclusion a prudent, reasonable person can draw from this state of affairs is that Adobe consciously and deliberately want to kill these forums by attrition—without a the PR hit they would otherwise take if they suddenly just shut them down.

  • Loading Multiple Text files

    Hi! I've got several archived text files - 040107.txt,
    040207.txt, 040307.txt, for example - and I want to be able to
    build a dynamic link which loads whichever file is selected into
    the Flash movie. This list needs to be able to build itself as I
    write new files every day and add the old ones to the archive. I'm
    stumped. How can I do this?

    If you are using XML to load data, then use the CDATA to wrap
    the html text.
    If you are using LoadVars to load data, be sure you do not
    have any & in the text content. If you do convert to hex.
    Bottom line is you need to trace the text you load to see
    what you are getting.
    Flash should show HTML if you have the
    TextField.htmll
    property set to true which is also done in IDE with "Render Text as
    HTML". But you must use the
    TextField.htmlText
    property to set the text.
    Finally malformed HTML in Flash TextFields generally dies
    like you describe.
    You should be able to test the display of data in dynamic
    TextFields with a simple Flash movie containing the TextField and
    the text stored in a variable and then loaded into the htmlText
    property. If it is not working there then you have to look at the
    data.

  • HtmlText not working

    I am using the following to load a file that I have put some
    html code <b> that is not being rendered as html. This is the
    script I am using. Am I missing something?
    myData = new LoadVars();
    myData.onLoad = function(){
    content_pc.htmlText = this.var1;
    myData.load("pp.txt");
    stop();
    Thanks

    VernMan,
    > I am using the following to load a file that I have put
    some
    > html code <b> that is not being rendered as html.
    This is
    > the script I am using. Am I missing something?
    >
    > myData = new LoadVars();
    > myData.onLoad = function(){
    > content_pc.htmlText = this.var1;
    > };
    > myData.load("pp.txt");
    > stop();
    Is your text field dynamic? Is it set to render text as
    HTML?
    myData.onLoad = function() {
    content_pc.html = true;
    content_pc.htmlText = this.var1;
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

Maybe you are looking for

  • Setting output aspect ratio

    I have a jpeg background with 1080p video scaled down to 16.2%  overlayed over it. It also has a powerpoint (jpeg) overlayed on it.  The final product is an instructor to the right of the powerpoint discussing his presentation. Everything is square p

  • Hose Bank & FBZP Config

    Hi Our client is  not using APP (Automatic Payment Program) Payment to the majority Vendors will be manage through hand written checks.Only for some Banks they are going to use check printing functionality with T Code F-58 To faciliate  this  is it r

  • Steps to create a VI to read multiple channels

    This is the first time I've used LabView.  I want to create a VI to be able to read viltages from multiple channels and output the value of each channel to individual numeric indicators in the VI.  I know how to read a single channel and I've created

  • Queued Vs Unserialized V3 Update.

    Hi BW experts,   I am not clear about the difference between Queued delta and Unserialized V3 Update.And what are the disadvantages of V3 Update. Thanks in Advance. Thanks, Jelina.

  • How to enable Custome Attribute

    We wanted to create custome attribute for Version dimension in planning appliction but this option is disabled in planning web for this dimension property. How to enable the custome attribute option for version dimension in Hyperion Planning applicat