0

私はフラッシュ10 cs5 as3でテキストエリアを使用しています。問題は、テキストを選択してステージの外に出てマウスを離れ、もう一度マウスをテキスト上に移動すると、テキストの選択がマウスで移動することです。

その原因は次のとおりです。

* 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" の場合、これが行われないことがわかりました。これに対する解決策はありますか?

4

1 に答える 1

0

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();
}
于 2010-10-12T03:56:18.543 に答える