03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

textfield_txt.border = true;<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 100, 100, 160,<br />

120);<br />

my_txt.border = true;<br />

var mouseListener:Object = new Object();<br />

mouseListener.onMouseMove = function() {<br />

mouse_txt.text = "MOUSE ... X:" + Math.round(_xmouse) + ",\tY:" +<br />

Math.round(_ymouse);<br />

textfield_txt.text = "TEXTFIELD ... X:" + Math.round(my_txt._xmouse) +<br />

",\tY:" +<br />

Math.round(my_txt._ymouse);<br />

}<br />

Mouse.addListener(mouseListener);<br />

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

See also<br />

_ymouse (TextField._ymouse property)<br />

_xscale (TextField._xscale property)<br />

public _xscale : Number<br />

Determines the horizontal scale of the text field as applied from the registration point of the<br />

text field, expressed as a percentage. The default registration point is (0,0).<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Example<br />

The following example scales the my_txt instance when you click the scaleUp_btn <strong>and</strong><br />

scaleDown_btn instances.<br />

this.createTextField("my_txt", 99, 10, 40, 100, 22);<br />

my_txt.autoSize = true;<br />

my_txt.border = true;<br />

my_txt.selectable = false;<br />

my_txt.text = "Sample text goes here.";<br />

scaleUp_btn.onRelease = function() {<br />

my_txt._xscale = 2;<br />

my_txt._yscale = 2;<br />

}<br />

1246 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!