Select all the text in the control with AS3

Does anyone know how to select all the text in a text control (text, textarea, etc.) with AS3?

Thank you.

Answered my own question.

Set the properties selectionBeginIndex and selectionEndIndex of text controls.

For example, this selects all the text in a text box:
yourTextArea.selectionBeginIndex = 0;
yourTextArea.selectionEndIndex = yourTextArea.text.length;

Tags: Flex

Similar Questions

  • Select all the elements with the same name of XMLTYPE

    Hello

    I have the following xml code stored in the XMLTYPE column:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0  -->
    <!-- 2016-01-02T23:09:52 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8f749217-51eb-4c79-9b11-5a3e11b5b1b4">
        <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="MyXE_ssh"/>
        <queryString>
            <![CDATA[select * from dept where deptno=10]]>
        </queryString>
        <field name="DEPTNO" class="java.math.BigDecimal"/>
        <field name="DNAME" class="java.lang.String"/>
        <background>
            <band splitType="Stretch"/>
        </background>
        <title>
            <band height="221" splitType="Stretch">
                <staticText>
                    <reportElement x="7" y="2" width="100" height="30" uuid="2bc03b83-e484-46e5-8681-48a9b01ac437"/>
                    <text><![CDATA[DEPTNO]]></text>
                </staticText>
                <staticText>
                    <reportElement x="160" y="2" width="100" height="30" uuid="3dfc25f3-6ff1-4186-8ee6-c71759a749a7"/>
                    <text><![CDATA[DNAME]]></text>
                </staticText>
                <subreport>
                    <reportElement x="10" y="60" width="544" height="20" uuid="e947974e-27bc-4b90-b0ee-f709b969c91b"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression>
                </subreport>
            </band>
        </title>
        <pageHeader>
            <band height="73" splitType="Stretch"/>
        </pageHeader>
        <columnHeader>
            <band height="36" splitType="Stretch"/>
        </columnHeader>
        <detail>
            <band height="35" splitType="Stretch"/>
        </detail>
        <columnFooter>
            <band height="45" splitType="Stretch"/>
        </columnFooter>
        <pageFooter>
            <band height="54" splitType="Stretch"/>
        </pageFooter>
        <summary>
            <band height="44" splitType="Stretch">
                <subreport>
                    <reportElement x="130" y="10" width="200" height="34" uuid="892a1adf-f7e7-4804-8f7f-a5227516afb5"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["rep1/subrep2.jasper"]]></subreportExpression>
                </subreport>
            </band>
        </summary>
    </jasperReport>
    

    Please, is it possible to select all < subreport > items, so the result of a query would be something like:

    <subreport>
                    <reportElement x="10" y="60" width="544" height="20" uuid="e947974e-27bc-4b90-b0ee-f709b969c91b"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression>
     </subreport>
     <subreport>
                    <reportElement x="130" y="10" width="200" height="34" uuid="892a1adf-f7e7-4804-8f7f-a5227516afb5"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["rep1/subrep2.jasper"]]></subreportExpression>
    </subreport>
    

    The problem is this subreport sections can be nested more or less anywhere, so I do not know the path. Any suggestions would be much appreciated.

    Thank you

    Pavel

    The XPath ' / /' means selects nodes in the document from the current node that match the selection, regardless of where they are.  If the XPath ' / / the subreport ' will extract all nodes called subreport wherever they are in the document or not.  So something like...

    data (donnees_xml))

    Select xmltype)

    '

    "http://JasperReports.sourceforge.net/JasperReports" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" "xsi: schemaLocation ="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"name ="Blank_A4"pageWidth ="595"pageHeight = columnWidth"842"="555"leftMargin ="20"rightMargin ="20"topMargin ="20"bottomMargin ="20"uuid ="8f749217-51eb-4c79-9b11-5a3e11b5b1b4">

    <p class="reply"> <p class="reply"><band height="221" splittype="Stretch"><p class="reply"> <p class="reply"><staticText><p class="reply"> <p class="reply"><reportElement x="7" y="2" width="100" height="30" uuid="2bc03b83-e484-46e5-8681-48a9b01ac437"></reportElement></p> <p class="reply"><text><![CDATA[DEPTNO]]></text></p> <p class="reply"></staticText></p> <p class="reply"><staticText><p class="reply"> <p class="reply"><reportElement x="160" y="2" width="100" height="30" uuid="3dfc25f3-6ff1-4186-8ee6-c71759a749a7"></reportElement></p> <p class="reply"><text><![CDATA[DNAME]]></text></p> <p class="reply"></staticText></p> <p class="reply"><subreport><p class="reply"> <p class="reply"><reportElement x="10" y="60" width="544" height="20" uuid="e947974e-27bc-4b90-b0ee-f709b969c91b"></reportElement></p> <p class="reply"><connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression></p> <p class="reply"><subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression></p> <p class="reply"></subreport></p> <p class="reply"></band></p> <p class="reply">

    the double)

    Select *.

    from xmltable (XMLNamespaces (DEFAULT 'http://jasperreports.sourceforge.net/jasperreports'),

    ' / / the subreport '

    passage (select donnees_xml data)

    columns

    xmltype subreport path '.')

    SUBREPORT

    http://JasperReports.sourceforge.NET/JasperReports">

    http://JasperReports.sourceforge.NET/JasperReports">

    2 selected lines.

  • Select all the objects with 2pt STROKE?

    It is possible to select all objects with a particular characteristic, such as a specific line width? I know I can do this by selecting an object, and then choose Select all. But I want to include as part of a batch action, so I need to be able to specify the choice so that it can be completely automated. If I have to choose one of the objects for each file, it defeats the purpose of the action of batch processing.

    If this is not possible, I should ask in the forum script to help a script?

    NW

    With nothing selected, the value of the weight of the 2pt race. Now select > same > weight of the race.

    Set the weight of the race is registrable and if nothing is selected, then select it > same commands using what is defined in the panels.

  • Select all the script maps

    Hi all

    Hoping someone out there can help, I need my script to end with one of the following 3 options:

    Select all: as in "cmd one"

    Select all the objects on the layer "Tabs".

    Select all the objects with the Script title boxes"tabs".

    Reason being, when the script ends I need a bunch of boxes to be pre-selected loan for a manual deselect by 1 point (chosen by the user) and then they Deletes selected objects manually to finish. (I didn't understand my original script here as has no impact on the autonomous part I need for the final selection)

    Hoping that this is a simple script but as it is rare to have a script of object selection and not do something with them, I think it's impossible to create.

    Thank you, Bren

    Read the object model and you will find that the equivalent script Cmnd + A is as follows:

    app.selection = null;
    pItems = app.windows[0].activeSpread.pageItems;
    app.select (pItems, SelectionOptions.ADD_TO);
    

    To select all items in the layer tab page, filter the items in the page:

    app.selection = null;
    pItems = app.windows[0].activeSpread.pageItems;
    
    for (i = pItems.length-1; i >= 0; i--) {
      if (pItems[i].itemLayer.name === 'Tab') {
        app.select (pItems[i], SelectionOptions.ADD_TO);
      }
    }
    

    To select objects with a certain script label is a variant of the (or an addition to) the second script.

    Peter

  • How to select all the text with QNX TextInput

    With QNX TextInput, is there a way to select all the text? Spark TextInput a selectAll() method to select all text, but I do not see a similar method in QNX TextInput. No idea how you can choose all the texts with QNX TextInput. Thank you.

    Hey French,.

    Thanks for the clarification! I think I can help you. Here is a code example to show my explanation. In the code below when a user clicks the LabelButton object it will assign the focus to your TextInput object and then select all the text in this object. The only downside is that it will not bring the keyboard. so far, we are not successfully by invoking the keyboard without the user clicking on the TextInput. in any case in the code below, we use TextInput property the textField object as a reference to the TextField object internal. from there, we use the setSelection() method to select the text inside the object from the start to the end position pos. Here's the same code:

    package
    {
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.events.FocusEvent;
        import flash.events.MouseEvent;
    
        import qnx.ui.buttons.LabelButton;
        import qnx.ui.text.TextInput;
    
        [SWF(width="1024",height="600",backgroundColor="#CCCCCC",frameRate="30")]
        public class TextInputTest extends Sprite
        {
    
            private var myInput:TextInput;
    
            public function TextInputTest()
            {
                super();
    
                // support autoOrients
                stage.align = StageAlign.TOP_LEFT;
                stage.scaleMode = StageScaleMode.NO_SCALE;
    
                myInput = new TextInput();
                myInput.setSize(300,50);
    
                addChild(myInput);          
    
                var newBtn:LabelButton = new LabelButton();
                newBtn.label = "Click Me";
                newBtn.setPosition(325, 0);
    
                newBtn.addEventListener(MouseEvent.CLICK, selectMyText);
    
                addChild(newBtn);
    
            }
            private function selectMyText(e:MouseEvent):void
            {
                stage.focus = myInput;
                myInput.textField.setSelection(0, myInput.textField.length);
            }
        }
    }
    

    hope it's what you want. Good luck!

  • How to select all the text fields at a given time in Adobe Reader ms?

    I created a document that contains more than one text field I created with Acrobat Pro DC, I want to allow the user the ability to select all fields in order to change the text size/color and fonts at the same time... not having to go through the entire form and must make each field separately. To be a little more specific, the document is two pages with six place/lounge cards per page, designed for weddings and other events. Each place card has a field for 'user name' and ' number of table: my question is...» Is it possible to 'select all fields' in Adobe Reader? If I go to Edition > select all, the program selects all graphics and none of the text fields. Not exactly what I'm missing here and I can not find my answer online. Any information would be greatly appreciated.

    Thank you!

    Jodi

    In this case, you can only change the properties of the text selected within a field. Acrobat Reader cannot change the properties of the text field.

  • by selecting all the blocks of text on all visible layers

    I want to select all the blocks of text on all visible layers.

    the script below will select all the blocks of text, even in groups, but if the layer with the text is invisible the script error. (target layer cannot be changed)

    If (app.documents.length > 0) {}

    var doc = app.activeDocument;

    var numTextFrames = 0;

    for (i = 0; i < doc.textFrames.length; i ++) {}

    textArtRange = doc.textFrames [i];

    textArtRange.selected = true;

    }

    }

    So I made this script to select blocks of text on only visible layers, but now missing text belonging to a group.

    var layerCount = activeDocument.layers.length;

    var docSelected = activeDocument.selection;

    for (i = 0; i < layerCount; i ++)

    {

    currentLayer = activeDocument.layers [i];

    If (currentLayer.visible == visible)

    {

    for (j = 0; j < currentLayer.textFrames.length; j ++) {}

    textArtRange = currentLayer.textFrames [j];

    textArtRange.selected = true;

    }

    }

    }

    can someone tell me why it is not some frames of text bound in a group when made this way and is it possible to get all managers of related texts selected on all visible layers?

    Thank you

    Duane

    Try this:

    if (app.documents.length > 0 ) {
        var doc = app.activeDocument;
        var numTextFrames = 0;
        for (  i = 0; i < doc.textFrames.length; i++ ) {
            try {
            textArtRange = doc.textFrames[i];
            textArtRange.selected = true;
            } catch (e) {}
            }
        }
    

    Have fun

  • How to select all the text, all layers including locked or not visible, using VBScript?

    I'm looking for the more elegant syntax through a document and select all the text frames.

    You cannot select objects in... locked or hidden layers, so you will need to unlock/show layer and do what you need to do with the text, while the layer is visible/unlocked.

    to get all the loop text through the text in the object of the document, you will get all the text elements. If you loop through text in a layer object, you won't get the text located within groups.

  • How to select all the text in the document?

    I need to select all the text in a long export to RTF document. I only seem to be able to select a story. Any ideas of how I can do?

    Thank you

    Ian

    Cannot be done. You will need to attach all the text boxes in a long history, or to use the 'ExportAllStories.jsx' script that comes with your installation default InDesign.

    There are other alternatives (each using scripts), and the best way may depend on what are your intentions with the exported file - for example, if you want to read back into their original text after the mounting frames, well, there are ways to do it.

  • (PS CS3) Select all the text to change the fill color?

    I have a graphic with text: the text was not inserted by Photoshop, and it is not available as text; It's just a part of the graph.  I would like to change the color of the text.

    I can select each letter and each block of punctuation, etc. by using the magic wand and shift + click on each element.  Is it possible, however, simply select all the text - or at least a line full - with one or two moves or orders, vice boredom with a click on each letter, comma, I dot and so on?

    Ed

    If all letters are the same color, magic wand selects all with a click on a such contiguous is disabled in the panels of options at the top of the screen under the main menu.

  • How to select all the text in the active text block?

    Hello!

    I need a simple script for:

    1. Select all the text in the active frame (ctrl + A)

    2. Paste from the Clipboard (ctrl + V)

    3. go in the beginning new text (ctrl + Home)

    and

    4. Insert the 2 paragraph marks (press enter 2 x).

    That's all.

    I tried, but I'm not not an expert, only good script in DTP and pre-press.

    Thank you.

    Here you go again-

    if (app.selection.length > 0 && app.selection[0].hasOwnProperty ('parentTextFrames')) {
        frame = app.selection[0].parentTextFrames[0];
        frame.parentStory.contents = '';
        frame.insertionPoints[0].select();
        app.paste();
        frame.parentStory.insertionPoints[-1].contents = '\r\r';
    }
    

    Peter

  • I need to select all the blocks of text in a document and align text blocks in the back pages left frame margin and the text in the pages front to the right margin.

    Hello

    Am new to Java script.

    Can someone help me out here, I need to select all the blocks of text in a document and align text blocks in the pages back to the left margin frames and text in pages recto at the right margin.

    Thank you
    Harish

    Hi Harish,

    Try this.

    var doc =app.activeDocument,
        _pages = doc.pages;
    doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
    for(var i =0;i<_pages.length;i++)
    {
            txfms = _pages[i].textFrames.everyItem().getElements();
            for(var j =0;j
    

    Kind regards

    Cognet

  • How can I select all the cells in an AdvancedDataGrid with ActionScript?

    How can I select all the cells in an AdvancedDataGrid with ActionScript? I selectionMode = "multipleCells" and designViewDataType = "flat".
    Basically, I have a contextmenu and want to add a "select all" option.

    Thank you

    Yes you can do in actionscript as well.
    If selectionMode is set to multipleCells then:
    Section A Code attached

    If selectedMode is set to multipleRows, then there are two ways to do it.
    1 - the solution is given by Bryan Dresselhaus in his last message.
    2-section B in the attached Code

  • Properties tab shows 3609 files, when you select all the files it only shows the files in 1974?

    When I right click and select Properties tab it shows 3609 files, when selecting all the files to copy shows only the files of 1974?

    Hello Tony,.

    If it is certainly a big difference, I think that for most all of this is taken up by folders and subfolders which are mainly empty place holders. Have you looked at the folder with Windows Explorer? A freeware application that can help is WizTree, it provides both a performance graphics and text of what's on your hard drive (or part of it). Can be very educational. Download here: http://antibody-software.com/web/software/software/wiztree-finds-the-files-and-folders-using-the-most-disk-space-on-your-hard-drive/ .

    Let me know if this helps you.

    Kind regards

    BearPup

  • Error when selecting all the columns in the table

    Hi all

    When I write a query by selecting all the columns of the table fromo using * function as well as another new column, I get the error,

    Select *, to_char (hiredate, 'fmday') day

    WCP

    where to_char (hiredate, 'fmday') ('Monday');

    ERROR on line 1:

    ORA-00923: THE KEYWORD not found where expected

    I need all the columns in the table with the column user-defined 'day '. Is there a way I can get the result like this?

    Hello

    padders wrote:

    Alias table to use...

    Or the name of the table, for example

    Select emp.*, to_char (hiredate, "fmday") as day

    WCP

    where to_char (hiredate, 'fmday') ('Monday');

    The bottom line is that * must be qualified (with a table name or alias) when the SELECT clause includes anything else besides *.

Maybe you are looking for