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 8064071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:15:20+00:00 2026-06-05T11:15:20+00:00

Can any one please tell me how to check whether the text in a

  • 0

Can any one please tell me how to check whether the text in a mx textinput control is selected or not.I have some controls like mx textinput, mx textara and richtexteditor. selection comes from when user drags it or double click on any control the selection highlights at that time i want to know which control is selected.I have seen the solution for spark textinput which is posted in stackoverflow
How to access the selected text in a Flex TextInput control
but i want for mx components.Please tell me how to know which control text is selected for textinput,textarea and richtexteditor controls.
Thanks

  • 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-06-05T11:15:21+00:00Added an answer on June 5, 2026 at 11:15 am

    For TextInput and TextArea:

    // to check for any selected text:
    var hasSelection:Boolean = (component.selectionBeginIndex!=component.selectionEndIndex);
    // to get the selected text:
    var selection:String = component.text.substring(component.selectionBeginIndex,component.selectionEndIndex);
    

    For RichTextEditor:

    // to check for any selected text:
    var hasSelection:Boolean = (component.selection.beginIndex!=component.selection.endIndex);
    // to get the selected text:
    var selection:String = component.selection.text;
    

    This will check if the component has any selected text, but not whether the component is selected; the text selection stays even when the component loses focus. The easy way to check if the component actually has focus is by setting a boolean flag in the component’s focusIn and focusOut events. You could also deselect the text in a focusOut event:

    component.selectionEndIndex = 0; // clear selection
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1)Can Any one please tell me what are the prerequisites have been installed on
Can any one please tell a code for unchecking a entire check marks in
Can any one please tell me how to set notifications for different values at
Can any one please tell me the difference between target and currenttarget in flex?
can any one please tell me how to get the Google places api key
Can anyone please tell me how to check whether the entered amount (Indian currency)
Can any one please tell me where to find a simple tutorial that shows
I am new to cocoa development Can any one please tell me how I
I want to check the validity of my network connection. Can anyone please tell
Please check this page . You can see some css dropdowns in the right

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.