Posted
Filed under Action Script

Unfortunatly, no method exits on the TextField class in AS3 as it does not extend the Sprite class, which contains the buttonMode property.

This is most apparent with the annoying problem of having a TextField inside your Sprite/MovieClip you;re trying to use as a button, where even after setting buttonMode = true on the button, rolling over the textfield inside the button will revert the Cursor back to default.

To get round this simply use the mouseChildren = false property on your Sprite/Movieclip button.

i.e.

myTextFieldContainingSprite.buttonMode = true;

myTextFieldContainingSprite.mouseChildren = false;

myTextFieldContainingSprite.addEventListener(MouseEvent.MOUSE_DOWN …… etc

2010/05/26 21:29 2010/05/26 21:29