wmode="opaque" causes selection on textarea to behave wierdly after mouse is pressed and left stage
I m using textarea in flash 10 cs5 as3. The problem is when i try to select a text and go out of stage and leave the mouse开发者_C百科 then again move mouse on text then selection of text will move with the mouse.
Here is what causes that:
* click somewhere on the text and drag the mouse in order to select the text
* then go out of the swf
* leave the mouse
* now move mouse on textarea
-> the selection of text will move with the mouse...
How to stop this behavior????
I tried to implement mouseleave on stage but the problem is i m not able to detect mouseleave event when mouse is pressed and it leaves the stage.
This is because of wmode="opaque" parameter. I found out that it doesn't do this when wmode="window". Is there a solution for this?
IF you are using TLF TextField and events are attached to TextField and a is the name of the TextField then try this code
import flash.events.MouseEvent;
a.addEventListener(MouseEvent.MOUSE_DOWN , startdrag);
stage.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
function startdrag(evt:MouseEvent):void
{
a.startDrag(true);
}
function stopdrag(evt:MouseEvent):void
{
a.stopDrag();
}
精彩评论