Solved

How to automatically deselect a selected text in a selectable textarea

Posted on 2003-10-24
3
310 Views
Last Modified: 2009-12-16
Hi there

I' ve got a selectable textarea
I would like that when  I release the mouse button after selecting a text, the text is automatically deselected...

do you know how to do it??

BRX
0
Comment
Question by:BRX
  • 3
3 Comments
 
LVL 5

Accepted Solution

by:
Calron earned 50 total points
Comment Utility
Here's a method that works:

listener = new Object();
listener.onMouseUp = function() {
      if (Selection.getFocus() == "_level0.txt") {
            Selection.setSelection(Selection.getCaretIndex(), Selection.getCaretIndex());
      }
}
Mouse.addListener(listener);


instead of "_level0.txt" you will have to put in the path to your own textfield (to find out what the exact path is, use this method:

listener = new Object();
listener.onMouseUp = function() {
      trace (Selection.getFocus());
}
Mouse.addListener(listener);

then click in your textfield and the path will print out.


You still have one problem here, you can still select text by using shift - arrow button, but at least the selecting with the mouse will be stopped.
0
 
LVL 5

Expert Comment

by:Calron
Comment Utility
Oh, just a side mention, this code is tested on Flash MX, it probably won't work on pre Flash MX
0
 
LVL 5

Expert Comment

by:Calron
Comment Utility
Thanks for the points, just a question, why the B grade? It's not that I want you to change the grade, I would like to know what was missing for an A so at a next time I can provide the missing bit as well ....
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

772 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

16 Experts available now in Live!

Get 1:1 Help Now