03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - 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.

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

// define a function that executes when a user clicks the mouse<br />

myMouseListener.onMouseDown = function() {<br />

left_txt.autoSize = "left";<br />

left_txt.text = "This is much longer text";<br />

center_txt.autoSize = "center";<br />

center_txt.text = "This is much longer text";<br />

right_txt.autoSize = "right";<br />

right_txt.text = "This is much longer text";<br />

true_txt.autoSize = true;<br />

true_txt.text = "This is much longer text";<br />

false_txt.autoSize = false;<br />

false_txt.text = "This is much longer text";<br />

};<br />

// register the listener object with the Mouse object<br />

Mouse.addListener(myMouseListener);<br />

background (TextField.background property)<br />

public background : Boolean<br />

Specifies if the text field has a background fill. If true, the text field has a background fill. If<br />

false, the text field has no background fill.<br />

Example<br />

The following example creates a text field with a background color that toggles on <strong>and</strong> off<br />

when nearly any key on the keyboard is pressed.<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 320,<br />

240);<br />

my_txt.border = true;<br />

my_txt.text = "Lorum ipsum";<br />

my_txt.backgroundColor = 0xFF0000;<br />

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

keyListener.onKeyDown = function() {<br />

my_txt.background = !my_txt.background;<br />

};<br />

Key.addListener(keyListener);<br />

backgroundColor (TextField.backgroundColor<br />

property)<br />

public backgroundColor : Number<br />

TextField 617

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

Saved successfully!

Ooh no, something went wrong!