Button
297
_ymouse (Button._ymouse property)
public _ymouse :
Number
[read-only]
Returns the
y
coordinate of the mouse position relative to the button.
Note:
The
_ymouse
property is supported for Flash Lite 2.0 only if
System.capabilities.hasMouse is true
or
System.capabilities.hasStylus is
true
.
Availability:
ActionScript 1.0; Flash Lite 2.0
Example
The following example displays the x coordinate of the mouse position for the Stage and a
button called
my_btn
that is placed on the Stage. Enter the following ActionScript in Frame 1
of the Timeline:
this.createTextField("mouse_txt", 999, 5, 5, 150, 40);
mouse_txt.html = true;
mouse_txt.wordWrap = true;
mouse_txt.border = true;
mouse_txt.autoSize = true;
mouse_txt.selectable = false;
//
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
var table_str:String = "<textformat tabstops='[50,100]'>";
tab= "<b>Stage</b>\t"+"x:"+"\t"+"y:"+newline;
tab= "<b>Button</
b>\t"+"x:"+my_btn."\t"+"y:"+my_btn.newline;
tab= "</textformat>";
mouse_txt.htmlText = table_str;
};
Mouse.addListener(mouseListener);
See also
_xmouse (Button._xmouse property)
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...