Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4345930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:06:16+00:00 2026-05-21T12:06:16+00:00

I have an application that replaces the selected text in the row for the

  • 0

I have an application that replaces the selected text in the row for the selected symbol from tilelist, which are loaded dynamically characters!
I do not know how to do that would be able to determine how many characters are selected, if you select a symbol, then download certain characters (replace) and if other then the other characters, if characters are not selected as or selected as tsyfry … then the message …

I made ​​just to highlight character is replaced by selected from tilelist …
How do the rest! please help ….

<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    applicationComplete="contactsService.send()"
    creationComplete="init()" 
    layout="absolute" viewSourceURL="srcview/index.html">
    <fx:Script>
        <![CDATA[

            private function replaceSelect(event:MouseEvent):void
            {
                var obj:Object = lst.selectedItem;
                var selStr:int = txt.selectionBeginIndex;
                var selEnd:int = txt.selectionEndIndex;

                if((lst.selectedItem != null)&&(selStr!=selEnd))
                {
                    txt.text = txt.text.substring(0,selStr)+lst.selectedItem.toString()+txt.text.substring(selEnd,txt.text.length)
                }
                lst.visible = false;
            }           

            [Bindable]
            private var cm:ContextMenu;

            private function init():void {
                var cmi:ContextMenuItem = new ContextMenuItem("Special Characters", true);
                cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, cmSelect);
                cm = new ContextMenu();
                cm.hideBuiltInItems();
                cm.customItems = [cmi];

            }

            private function cmSelect(evt:ContextMenuEvent):void {
                lst.visible = true;

            }

        ]]>
    </fx:Script>
    <fx:Declarations>
        <mx:HTTPService id="contactsService"
                        resultFormat="e4x"
                        url="symbols.xml"/>
    </fx:Declarations>
    <mx:Panel width="508" height="487" x="20" y="20">
        <mx:TextInput 
            id="txt" 
            text="Test String Flex" 
            contextMenu="{cm}" 
            width="303"/>
        <mx:TileList 
            id="lst" 
            visible="false" 
            dataProvider="{contactsService.lastResult.symb}" 
            columnCount="4"
            columnWidth="25"
            rowCount="3"
            rowHeight="25"
            verticalScrollPolicy="on"
            click="{replaceSelect(event)}"/>
    </mx:Panel>
</mx:Application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:06:17+00:00Added an answer on May 21, 2026 at 12:06 pm

    To get user selected STRING you can get it Like this

    var userSelectedText:String  = txt.text.substring(selStr, selEnd);
    

    and user selected Symbol can be get as

    var userSelectedSymbol:String = lst.selectedItem.toString();
    

    and you can use array to maintain repalce history as

    Declare Array at class level

    var repalceHistory :Array = ne Array();
    

    and Save user action as

    var action:Object = new Object();
    action.symbol = userSelectedSymbol;
    action.selectedText = userSelectedText;
    
    repalceHistory.push(action);
    

    and can get History as

    var action:Object = repalceHistory.pop();
    

    Hopes that helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a cocoa application, that on pressing a certain key gets selected text
We have an application that allows users to add/edit/replace/delete content (text, images, swfs, mp3s,
I have an application that is successfully deploying on tomcat, which I must migrate
I have an application that replaces a physical function keyboard with keys on the
I have gwt web project, which must use application.properties (on client side) loaded as
I have an application I wrote that replaces Windows Explorer as a shell for
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in
I have application that brings response via Ajax and creates 5-20 new jQuery click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.