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.

emoveListener (Stage.removeListener method)<br />

public static removeListener(listener:Object) : Boolean<br />

Removes a listener object created with addListener().<br />

Parameters<br />

listener:Object - An object added to an object's callback list with addListener().<br />

Returns<br />

Boolean - A Boolean value.<br />

Example<br />

The following example displays the Stage dimensions in a dynamically created text field.<br />

When you resize the Stage, the values in the text field update. Create a button with an<br />

instance name remove_btn. Add the following ActionScript to Frame 1 of the Timeline.<br />

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

100, 22);<br />

stageSize_txt.autoSize = true;<br />

stageSize_txt.border = true;<br />

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

stageListener.onResize = function() {<br />

stageSize_txt.text = "w:"+Stage.width+", h:"+Stage.height;<br />

};<br />

Stage.addListener(stageListener);<br />

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

stageSize_txt.text = "Removing Stage listener...";<br />

Stage.removeListener(stageListener);<br />

}<br />

Select Control > Test Movie to test this example. The values you see in the text field are<br />

updated when you resize the testing environment. When you click remove_btn, the listener is<br />

removed <strong>and</strong> the values are no longer updated in the text field.<br />

See also<br />

addListener (Stage.addListener method)<br />

scaleMode (Stage.scaleMode property)<br />

public static scaleMode : String<br />

Stage 589

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

Saved successfully!

Ooh no, something went wrong!