Create a dynamic text in Flex with different attributes

I create a Flex text field that looks like this:

< mx:HBox id = "lastInfo" styleName = "Bar" width = "100%" visible = "false" >
< text mx:Text = "' your last question was:" styleName = "underline" / > "
< mx:Text id = "lastQuestion" styleName = "bold" / >
< mx:Text text = "in the context:" / >
< mx:Text id = "lastContext" styleName = "bold" / >
< text mx:Text = "' the last line:" styleName = "underline" / > "
< mx:Text id = "lastAnswers" styleName = "bold" / >
< / mx:HBox >

The text that is not dynamic needs to be emphasized. The text that arise in a dynamic way must be bold.

lastQuestion, lastContext and lastAnswers are dynamically filled. The problem is that if lastAnswers width exceeds the threshold of the HBox it isn't newline at the beginning of the complete chain.

How can I create this complete string dynamically and with highlights and fat all-in-one text, so it will be transport back to the beginning?

Hi Cootis,

Now, I understand your question, but the approach that you use is not correct I think because for the formatting you want you must use a single control and assign the htmlText dynamically.

See the code example below:


http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete ="init (); » >


   
private var lastQuestion:String = ""what is your name.'; "
private var lastContext:String = "your name";
private var lastAnswers:String = 'John John John JohnJohn-JohnJohn-JohnJohn-JohnJohn-JohnJohn-JohnJohn John';
      
public void init (): void
{
variableText.htmlText = "your last question was:" + lastQuestion + "context:" + lastContext + "the last replica:" + lastAnswers;
}
]]>


    

So you have to pouplate variables dynamically, that's all.

I hope it works for you.

If this post answers your question or assistance, please mark it as such.

Thank you

Jean Claude Chari

Tags: Flex

Similar Questions

  • I am trying to create dynamic landing pages that reflect the locations of my Google ads. How can I create a dynamic text on my landing page to specify the location in the title?

    I am trying to create dynamic landing pages that reflect the locations of my Google ads. How can I create a dynamic text on my landing page to specify the location in the title?

    Thanks a lot for your answer. I've sorted it now.

    Kind regards

    Gill

  • dynamic text field WordWrap is different on screen/print

    I have a strange problem - I put the contents of a dynamic text field (arial font) and he wordwraps somehow on the screen, and then when I print the same text field it encapsulates a little differently.

    which means on a textfield can be a line over long print flash think it is is (using textHeight), changing my layout code...

    any ideas?

    Stop press! I think I found the cause of problem/solution and that's to do with the smoothing option that I had selected. According to livedocs impression is not supported with advanced and custom anti-aliasing features. but as the anti-alias for animation is the smoothing option 'simple' (IE available prior to flash 8 and advanced anti-aliasing) should hopefully out more systematically (or at least that's what I see in practice).

    so the solution to ensure that the text field has been constantly printed with what was shown on the screen was to change "anti-alias for readability" to "anti-alias for animation".

  • How to create a dynamic text in AS2 box

    I am trying to create an area of dynamic text in AS2.  Here's what I have so far:

    Import mx.controls.TextArea;

    var myTextArea:TextArea = new TextArea();

    myTextArea.setSize (320, 240);

    myTextArea.move (10, 10);

    addChild (myTextArea);

    I have the textarea component in my library, but nothing appears on the screen.

    Help

    It sounds lie AS3 code.  Here is a link to an explanation of how to do to add components using AS2...

    http://help.Adobe.com/en_US/AS2LCR/Flash_10.0/help.HTML?content=00001820.html

  • Creating a line chart series multi with different data providers

    I have 3 providers of data of the same structure that is ArrayCollection of data collection and that you want to use to create a line chart multiseriate. I don't have just 1 dataProvider that can be used but 3 different data providers of the same structure I want to use each different series.

    [Bindable] private var orangeSales: ArrayCollection = collection

    new ArrayCollection collection)

    [{sale: 101000, month: new Date (January 1, 2008 "")},]

    {sale: 960000, month: new Date (February 1, 2008 ')},

    {sale: 475000, month: new Date (March 1, 2008 ')},

    {sale: 425000, month: new Date (April 1, 2008 "")}

    ] );

    [Bindable] private var appleSales: ArrayCollection = collection

    new ArrayCollection collection)

    [{Sales: 991000, month: new Date (January 1, 2008 "")},]

    {sale: 140000, month: new Date (February 1, 2008 ')},

    {sale: 565000, month: new Date (March 1, 2008 ')},

    {sale: 255000, month: new Date (April 1, 2008 "")}

    ] );

    [Bindable] private var bananaSales: ArrayCollection = collection

    new ArrayCollection collection)

    [{sale: 891000, month: new Date (January 1, 2008 "")},]

    {sale: 147560, month: new Date (February 1, 2008 ')},

    {sale: 295000, month: new Date (March 1, 2008 ')},

    {sale: 574000, month: new Date (April 1, 2008 "")}

    ] );

    I want to create a line chart with orangeSales, appleSales and bananaSales as three different lines on the graph for different specified dates.

    < mx:ColumnChart showDataTips = "true" >

    < mx:horizontalAxis >

    < mx:CategoryAxis

    dataProvider = "{orangeSales}".

    categoryField = 'months '.

    / >

    < / mx:horizontalAxis >

    < mx:series >

    < mx:LineSeries displayName = "OrangeSales" yField = "sale" xField = "month" dataProvider = "{orangeSales}" / >

    < mx:LineSeries displayName = "AppleSales" yField = "sale" xField = "month" dataProvider = "{appleSales}" / >

    < mx:LineSeries displayName = "BananaSales" yField = "sale" xField = "month" dataProvider = "{bananaSales}" / >

    < / mx:series >

    < / mx:ColumnChart >

    Help, please!

    Sorry for the confusion. In fact I do something wrong, such as using ColumnChart to display a line chart or something like that.

    Now, I realized that a multi series line graph can be built by the presence of a different data provider for each of the LineSeries object.

    If the code below would create a multi series line graph:

    [Bindable] private var orangeSales: ArrayCollection = collection

    new ArrayCollection collection)

    [{sale: 101000, month: new Date (January 1, 2008 "")},]

    {sale: 960000, month: new Date (February 1, 2008 ')},

    {sale: 475000, month: new Date (March 1, 2008 ')},

    {sale: 425000, month: new Date (April 1, 2008 "")}

    ] );

    [Bindable] private var appleSales: ArrayCollection = collection

    new ArrayCollection collection)

    [{Sales: 991000, month: new Date (January 1, 2008 "")},]

    {sale: 140000, month: new Date (February 1, 2008 ')},

    {sale: 565000, month: new Date (March 1, 2008 ')},

    {sale: 255000, month: new Date (April 1, 2008 "")}

    ] );

    [Bindable] private var bananaSales: ArrayCollection = collection

    new ArrayCollection collection)

    [{sale: 891000, month: new Date (January 1, 2008 "")},]

    {sale: 147560, month: new Date (February 1, 2008 ')},

    {sale: 295000, month: new Date (March 1, 2008 ')},

    {sale: 574000, month: new Date (April 1, 2008 "")}

    ] );

    I want to create a line chart with orangeSales, appleSales and bananaSales as three different lines on the graph for different specified dates.

    <>

    dataProvider = "{orangeSales}".

    categoryField = 'months '.

    />

  • Created way dynamic text Variable movie

    I created dynamically a clip that has a text box for it, but I can't get the text variable is displayed in the text box of the item.

    Here is my code. I wonder what I'm doing wrong? Any help would be greatly appreciated.

    I actually thought about it. I had a mental breakthrough when I posted it. I moved the

    pScenario.scenario_txt.htmlText = myScenario; After that, I added the mc at the scene. Works fine now!

  • I want to create a dynamic field which changes with a pull down menu in one of our forms.

    Hi guys,.

    First post so forgive me for breaks of OCD.

    Would anyone be able to help me, I want to be able to modify the send e-mail button so that when you click on submit will invest in a custom subject line, but this must change with a menu drop-down I have the form as well.

    If it is could is it possible you let me know?

    Thanks again

    p.s. If I don't clear my request made me know

    You should have mentioned that earlier... LCD forms are very different compared to PDF Forms.

    You should ask your question here: LiveCycle Designer

  • How to create a second Adobe PDF printer with different parameters?

    Hi all

    I know that it is possible to create copies more or less unlimited normal printers under Windows (XP SP2) which each have their own settings. Very useful for standard jobs that require special configurations.

    We want to use the same technique for the creation of PDF. Now, I'm wondering how to create a second Adobe PDF printer?

    I try to create a new printer on the printer port "my Documents\ * .pdf" which is used by the existing printer, but I wonder what driver to use. Unfortunately there is no Adobe entry in the list and I can not find manually, either.

    We are still on Acrobat 8 (Professional)

    Any tips?

    Thank you very much

    Mike

    The easiest way is to add a generic printer driver. Then enter the properties, change the name and set up the port and in the printer driver. Then edit the remaining properties. You may need to leave after selecting Properties and then open back for these properties took effect. If you are looking for using the PDF Maker printer you should change the name to Adobe PDF, and you can have one of these. For use as a printer, then the other name will work fine.

    It's been a while since I've done this type of addition, but it worked when I did it.

  • How to create a table/list out numbers with Boolean attributes

    Hello

    Maybe the title doesn't explain it too well but what I'm trying to do I guess must be honest, I don't know how!

    I want a table of numbers to be entered by a user, and for each of these numbers, I wish to have a Boolean value, (he will later choose what action is performed on this number)

    The table size can vary

    for example

    element numeric Boolean value

    0                       5                             True

    1                       20                           True

    2                       -5                            False

    3                       10                           True

    ..

    ..

    n                       100                         False

    I don't see any list with numerical and Boolean, maybe I just have not spotted or what I need to do somehow?

    Any suggestions please?

    Thank you!

    p.s. If someone else uses Opera Browser to post here, hitting enter work correctly for you when entering text? For me, it moves the cursor climb a line instead of to the bottom! Driving me crazy! It only happens with this forum OR

    There is no control that has something you're looking for, but a simple table of clusters can work. The cluster would have a digital and a Boolean value. It is not the largest interface, but you can do a little better by masking the display index for the table and the scroll bar visibility.

  • access with different attribute sequence

    <? XML version = "1.0" encoding = "UTF-8"? >

    < employees >

    < employee emplid = '1111' type = "admin" >

    < firstname > John < / name >

    < name > Watson < / lastname >

    < key alias 'Chinese' = > Moh < / alias >

    < key alias 'Japanese' = > Heruka < / alias >

    < key alias 'Vietnamese' = > Dung < / alias >

    < 30 > < / age >

    < Email > [email protected] < / email >

    < / employee >

    < employee emplid = "2222" type = "admin" >

    < firstname > Sherlock < / name >

    Houses < name > < / lastname >

    < 32 > < / age >

    < Email > [email protected] < / email >

    < / employee >

    < employee emplid = "3333" type = "user" >

    < firstname > Jim < / name >

    < name > Moriarty < / lastname >

    <>52 < / age >

    < Email > [email protected] < / email >

    < / employee >

    < employee emplid = "4444" type = "user" >

    Mycroft < firstname > < / name >

    < name > Holmes < / lastname >

    <>41 < / age >

    < Email > [email protected] < / email >

    < / employee >

    < / employees >

    CREATE TABLE oe. EMPLOYEESxx

    (

    ID NUMBER,

    XMLTYPE data

    );

    CREATE TABLE oe. EMPLOYEESxx

    (

    ID NUMBER,

    XMLTYPE data

    );

    INSERT INTO EMPLOYEESxx

    VALUES (emp_seq.nextval, XMLType (bfilename ('XMLDATA', 'emp_alias.xml'), nls_charset_id ('UTF8')))

    -work

    SELECT emp.id, x.*

    Of employeesxx emp.

    XMLTABLE ("/ employees/employees/alias")

    PASSAGE emp.data

    The COLUMNS firstname - VARCHAR2 (30) PATH "Alias."

    alias_Key PATH VARCHAR2 (60) "@key") x;

    -work

    -does not work...

    SELECT t.id, x.*

    Of employeesxx t.

    XMLTABLE ("/ employees/employee")

    PASSAGE t.data

    The COLUMNS firstname VARCHAR2 (30) PATH "first name",

    LastName VARCHAR2 (30) PATH "lastname."

    path of varchar2 (30) of alias_value 'alias '.

    ) x

    -does not work

    How I would be able to access the alias muliple for only one employee?

    for example

    If I want to...

    alias_key, alias_value

    Japanese, Heruka

    Depends on what you want exact release when there is more than one alias for an employee.

    For example, you can do something like this:

    SQL> select /*+ no_merge(x1) */
      2         x1.firstname
      3       , x1.lastname
      4       , x2.alias_key
      5       , x2.alias_val
      6  from employeesxx e
      7     , xmltable('/employees/employee'
      8         passing e.data
      9         columns firstname varchar2(30) path 'firstname'
    10               , lastname  varchar2(30) path 'lastname'
    11               , aliases   xmltype      path 'alias'
    12       ) x1
    13     , xmltable('/alias'
    14         passing x1.aliases
    15         columns alias_key varchar2(10) path '@key'
    16               , alias_val varchar2(30) path '.'
    17       ) (+) x2
    18  where e.id = 1 ;
    
    FIRSTNAME                      LASTNAME                       ALIAS_KEY  ALIAS_VAL
    ------------------------------ ------------------------------ ---------- ------------------------------
    John                           Watson                         chinese    Moh
    John                           Watson                         japanese   Heruka
    John                           Watson                         vietnamese Dung
    Sherlock                       Homes
    Jim                            Moriarty
    Mycroft                        Holmes                                   
    
    6 rows selected.
    

    Note: the NO_MERGE will be may not be not necessary, I used it to work around a bug with outer joins on my version (11.2.0.4)

  • Remove invalid in SV 11 x with different attributes

    Anyone could do this?

    When using variable attributes in x 11, invalid is returned in SV when an attribute does not apply.

    I would like to delete whole lines who are disabled.

    Than is available in SV (I see) in SV options, but I can't select it - it is greyed out.

    What I am doing wrong?

    Thank you

    Cameron Lackpour

    Hey Cameron,

    I do not think that you are doing something wrong, it is not yet supported, or is one of those features that they have not yet set.

    It seems that you can set removes them when you use Planning/HFM, but not in the essbase adhoc mode.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • changing flex inf flash dynamic text field?

    Hello

    I am developing a game in flex builder and I had a problem with dynamic text that I imported from flash. I want to insert a dashboard in my application and to do this, I use a dynamic text in flash. I create a dynamic text in flash, then an import to Flash Builder in a clip, and I called the dynamic text "Score." Now, I tried to use the variable 'Score' to change the value of the dynamic text box UN my flash builder application, but it doesn't change anything.

    I read somewhere that I learned to use the value of score.text to change the number of my points, but that does not work because Flash Builder tells me that this kind of variable contains the value .text.

    Thanks for trying to help me.

    Download the source of TinkSpark to http://code.google.com/p/tink/source/checkout and add the package to your project:

    Then write the following code:

    Import ws.tink.core.Library;
    Import ws.tink.events.LibraryEvent;
    Import ws.tink.managers.LibraryManager;

    private void loadLibrary (): void

    {

    Library: library of var = LibraryManager.libraryManager.createLibrary ("assetsLibrary");
    library.addEventListener (LibraryEvent.LOAD_COMPLETE, onAssetsLibraryLoadCompleteHandler, false, 0, true);
    library.loadSWF ("board.swf"); Specify the path to board.swf, pls, note board.swf is then exported as AS3.0
    }

    private function onAssetsLibraryLoadCompleteHandler (event: LibraryEvent): void
    {
    EventDispatcher (event.currentTarget) .removeEventListener (event.type, arguments.callee);
    Library: library of var = LibraryManager.libraryManager.getLibrary ("assetsLibrary");

    var AssetScore: Class = library.getDefinition ("Score");
    var Note: * = new AssetScore() as Sprite;
    score.scoreDisplay.text = "100";
    addChild (score);
    }

    Best regards

    Etienne Das

    http://deepanjandas.WordPress.com/

  • Weird problem with dynamic text

    Hello

    I created a dynamic text field - mediaImportName001 (created and it contains the name of a file that I have chosen to import them using a browser (as3 and AIR) button.)

    It works very well - I can import the file, and the name appears in the field.

    I would now like to pass the content of the text field to another text field.  But I'm not content. If I try to find the contents of the textField trace("mediaImportName"+thisNum).text - Flash returns "undefined" (even though I'm him asking to draw once the field has been filled).

    I use the following code to check that the material is really there and named correctly (the code returns the children):

    for (var i: uint = 0; i < this.numChildren; i ++) {}
    trace (this.getChildAt (i) .name + "\t type:" + typeof (this.getChildAt (i)) + "\t" + this.getChildAt (i));
    }

    It returns:

    object: type instance370 [object, form]
    object: type mediaImportName001 [TextField object]
    object: type mediaFiletype001 [TextField object]

    How can I get Flash to give me the text in mediaImportName001?

    It's weird - this.getChildAt (i) .name

    from above gives me...

    mediaImportName001,

    yet

    trace (['mediaImportName' + thisNum] .name);

    returns undefined (thisNum represents an increment I used to name several clips and text fields and in this case trace (thisNum); return 001)

    Any ideas why this happens?

    Thank you

    Shaun

    No logic problem, just a problem with describing the problem (as far as the fix goes) and using the property name (as far as the issue goes).  There is a difference between the creation of a dynamic textfield (a type of textfield) and dynamically a textfield (using code to create).

    In AS3, the name property is a property and it is not the same as the name of the instance that you can assign to an object on the stage.  To target an object using its name property, you must use the getChildByName() method, or alternatively, you can use the variable you used to create it.  You may need to cast as a TextField object as well as to operate...

    trace (TextField (this.getChildByName ("mediaImportName" + thisNum)). (Text);

    which would produce the same result as the use of...

    trace (mediaImportName.Text);

    I don't know how the numbering disperses on "001", but you might find it easier to work with by storing just the instances of an Array by using the media_file_num to set the index where they get.  Then, you would be able to target the textfield to help...

    trace (tfArray [thisNum]. (Text);

  • How to create a draggable text with a scroll bar box?

    I am trying to create a dynamic text box which can be moved around the screen using AS3.  The problem is that I need a scroll bar on the text because of the amount of text box.  I can create the text box and set the scrollbar component and turns everything into a movieclip.  However, when I do the draggable movieclip, he scrollbar becomes unusable.  If I do just the area of movable text inside the movieclip, then the scroll bar works, but not draggable and I get an error "Error #1069: property not found stopDrag on flash.text.TextField and there is no default value.»

    How to create a draggable text box that has a scroll bar attached?

    :

    Transcript_mc.fontBar.addEventListener (MouseEvent.MOUSE_DOWN, downF);

    Transcript_mc.fontBar.addEventListener (MouseEvent.MOUSE_UP, upF);

    function downF(e:MouseEvent):void {}

    Transcript_mc.StartDrag ();

    }

    function upF(e:MouseEvent):void {}

    Transcript_mc.stopDrag ();

    }

  • AA 9.0 / JavaScript: create a simple text (label)

    Hej,

    I create a dynamic form (table-layout) with JavaScript compatible with Adobe Acrobat 9.0.

    The form is made up of a variable number of lines specified in a settings object that is passed to the

    My FieldsSet object constructor. The columns are created during the use of the form

    by clicking on the button "add a new column.

    According to the description, everything works fine. But now I'm on the task of creating

    the row and column labels. But I really can't find anything in the reference, nor in the present

    Community, nor in google similar to 'create', 'Add', 'text' or 'label' that solves this.

    Good advice would be appreciated.

    Thank you

    Christian

    In this case, you can simply use a read-only text field.

Maybe you are looking for