I posted this is a related thread about a bug where SimpleButtons would mysteriously move to top left corner of the screen:
I was finally able to update to OpenFl 9.1.0 and found this SimpleButton bug to still exist. I’ve also discovered some other problems with the implementation of SimpleButtons stored in Flash swf files and building to HTML5.
If a SimpleButton has a textfield and the font for it has not been imbedded, the text doesn’t appear.
If a SimpleButton is made by having a sprite for a background with a static textfield in the middle for a label in the upstate frame, the downstate has its own background and static textfield, and a blank overstate, when the button is displayed, the textfield appears at the top of button, not in the middle. When the cursor is moved over the label, the textfield suddenly moves to it’s proper place.
If the overstate is a copy of the upstate, the label is displayed in the correct position, but when the cursor is moved over the button, the textfield disappears.
If the upstate and downstate are each a Sprite where upstate Sprite has a background and a textfield, and the downfield state has its own sprite contains sprite and textfield, everything works, BUT ONLY if the textfields are static. If they are dynamic, the text is not displayed.
If the upstate and downstate described in previous paragraph have their class defined, UpState and DownState, and the line var testBtn:SimpleButton = new SimpleButton(new UpState(), null, new DownState()); is used to create the button and the button is added to the stage, the button is displayed but even when enabled (testBtn.mouseEnabled = true; testBtn.useHandCursor = true; testBtn.enabled = true), the button is not enabled in any way, clicking it does nothing.
And as I said before, if the button is disabled (testBtn.enabled = false), the unwanted movement of the button occurs.
In OpenFl 8.9.6 and before, the SimpleButton class worked great. But since then it’s become virtual useless. Can someone explain why it hasn’t been fixed in the last 20+ months?