Solved

How to automatically deselect a selected text in a selectable textarea

Posted on 2003-10-24
3
335 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
ID: 9617954
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
ID: 9617956
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
ID: 9625802
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SWF won't scale? 4 524
Microsoft WSUS 4 97
adobe flash plugin has crashed while listening to pandora 2 71
How do I have music file play continuously on a website? 6 103
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

821 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