wmode=“不透明”导致按下鼠标并离开舞台后文本区域上的选择行为异常

发布于 2024-09-27 15:57:40 字数 469 浏览 0 评论 0原文

我在 flash 10 cs5 as3 中使用 textarea。问题是当我尝试选择文本并离开舞台并离开鼠标然后再次将鼠标移动到文本上时,选择的文本将随鼠标移动。

造成这种情况的原因如下:

* 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

->选择的文本将随鼠标移动...

如何停止这种行为???

我尝试在舞台上实现 mouseleave,但问题是当按下鼠标并离开舞台时,我无法检测到 mouseleave 事件。

这是因为 wmode="opaque" 参数。我发现当 wmode="window" 时它不会执行此操作。有解决办法吗?

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 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情深缘浅 2024-10-04 15:57:40

如果您使用 TLF TextField 并且事件附加到 TextField 并且 a 是 TextField 的名称,则尝试此代码

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();
}

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();
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文