Hi.
Unfortunately I cannot find any useful tutorial on how to make a simple text button using only code.
I have made a subclass of SimpleButton:
package {
import flash.display.SimpleButton;
public class Tbtn extends SimpleButton {
public function Tbtn() {
}
}
}Now I want to create a new TextField that is the button itself. The text is “PushMe”. The button should be clickable ofcourse (the hand should be displayed on mouse over).
I thought I make it as usual:
var textField:TextField = new TextField();
textField.text = “PushMe”;
addChild(textField);
But the SimpleButton class doesn’t seem to have such a method (addChild) at all. And I guess there’s more to be done (upState? overState maybe?).
Could you please post a simple example with a text button? I think I will be able to figure out the rest.
Thanx!