Edit Menu help

Posted on 2009-04-17
Last Modified: 2012-05-06
Hello friends,


I am developing web based flex application , which contains a menubar and few textinput controls.In the menu bar i have edit menu which includes cut,copy,paste,find,replace.The keyboard shortcut and context menu item for cut,copy,paste of the textinput are working fine.But i need to implement this funtionalties(cut,copy, paste,find,replace)in my custom menubar.How can i do this?.Please suggest me some good ideas and examples.


Question by:flex_mdu
    LVL 12

    Accepted Solution

    Assuming you want to Cut, Copy, Paste, Search and Replace contents of a RichTextEditor or TextArea control:

    1. For Find and Replace functionalities you can use the search, replace methods and Regular Expressions available for Flex String objects.

    a) For Cut, Copy & Paste in a RichTextEditor: you can access the selected text thru the selection property which is of type TextRange
    b) For Cut, Copy & Paste in a TextArea: you can access the selected text thru selectionBeginIndex and selectionEndIndex properties
    c) Once you have the selected text, it is just a matter of doing a combination of the following tasks: Storing the text in a variable, searching for the text, replacing the text, inserting the text inside the existing string.

    Author Comment

    can you giv some example code snippet

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now