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.

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

Example<br />

The following example scrolls the my_txt text field horizontally using two buttons called<br />

scrollLeft_btn <strong>and</strong> scrollRight_btn. The amount of scroll displays in a text field called<br />

scroll_txt. Add the following <strong>ActionScript</strong> to your FLA or AS file:<br />

this.createTextField("scroll_txt", this.getNextHighestDepth(), 10, 10, 160,<br />

20);<br />

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

22);<br />

my_txt.border = true;<br />

my_txt.multiline = false;<br />

my_txt.wordWrap = false;<br />

my_txt.text = "Lorem ipsum dolor sit amet, consectetuer adipiscing...";<br />

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

my_txt.hscroll -= 10;<br />

scroll_txt.text = my_txt.hscroll+" of "+my_txt.maxhscroll;<br />

};<br />

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

my_txt.hscroll += 10;<br />

scroll_txt.text = my_txt.hscroll+" of "+my_txt.maxhscroll;<br />

};<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 />

maxhscroll (TextField.maxhscroll property), scroll (TextField.scroll<br />

property)<br />

html (TextField.html property)<br />

public html : Boolean<br />

A flag that indicates whether the text field contains an HTML representation. If the html<br />

property is true, the text field is an HTML text field. If html is false, the text field is a non-<br />

HTML text field.<br />

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

1206 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!