В AS3 MOUSE_WHEEL - перехватывается браузером или работает но скрол в браузере все равно работает (ФЛЕШКА ЕРЗАЕТ ТУДА СЮДА).
Пробывал в AS2 там все гуд
Код:
AS2 - где inputText
inputText.onSetFocus = function(oldFocus) {
this.obj = new Object();
this.obj.parent = this
this.obj.onMouseDown = function() {
this = this.parent
this.caret = Selection.getCaretIndex();
}
Mouse.addListener(this.obj)
}
Код:
AS3
package
{
import flash.display.InteractiveObject;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.events.*;
public class FocusManagerExample extends MovieClip
{
public function FocusManagerExample() {
(this["txt"] as TextField).addEventListener(FocusEvent.FOCUS_IN, focusInFunc);
(this["txt"] as TextField).addEventListener(FocusEvent.FOCUS_OUT, focusOutFunc);
stage.focus = (this["txt"] as TextField);
}
private function focusInFunc(event:FocusEvent=null):void{
trace("FOCUS IN");
stage.focus = stage
stage.addEventListener(MouseEvent.MOUSE_WHEEL, wheleFunc);
stage.addEventListener(MouseEvent.MOUSE_DOWN, downFunc);
stage.addEventListener(MouseEvent.MOUSE_UP, downFunc);
(this["txt"] as TextField).setSelection(0,2);
}
private function focusOutFunc(event:FocusEvent=null):void{
trace("FOCUS OUT");
//(this["txt"] as TextField).(MouseEvent.MOUSE_WHEEL, wheleFunc);
}
private function downFunc(event:MouseEvent=null):void{
trace("downFunc");
//(this["txt"] as TextField).(MouseEvent.MOUSE_WHEEL, wheleFunc);
}
private function wheleFunc(event:MouseEvent=null):void{
trace("wheleFunc")
}
}
}
ктото решал?