March 23rd: SOLVED

After hours and hours of poking around, I’ve FINALLY figured out what was going wrong with my textfields. I’d localized it to the Level Editor class, but I couldn’t understand what it was that was different about the level editor that worked in other similar classes…

In openfl, apparently, if you set the .visible switch on a display object to false, it IMMEDIATELY LOSES FOCUS. I’m not sure if this is the case in standard Flash as well, but it’s pretty easy to test if you are so inclined. I suspect it is not, since this problem hadn’t emerged until now, though that also could have been just because I rewrote the relevant code when I ported over to Haxe/Openfl. Anyway, the Level Editor has several sub-editors, among them the tile editor, foreground editor, background editor, and in the main draw loop it would hide all of them and then reveal only the editor which was currently in use. So, on every update, immediately after the mouse click selecting the text field, that text field would lose focus and become impossible to edit. All I had to do was change it so it doesn’t hide the active window and it worked fine.

This is a huge fucking relief. It took so damn long to figure out this stupid little problem. Now… well, I’ve tested it out and the standard string control works fine, the number controls all work, but the text array component could use some work. So that’s what’s next. There’s also a bit of polish required on other scrolling window elements, so I’ll be basically just poking around trying to figure that all out over the next couple of days. I feel a lot freer now that I don’t have to worry about this shit any more.


About problemmachine

What is the nature of your problem? Can we modify the nature of your problem? Can your problem be touched? Eaten? May we eat your problem for you? May we eat your soul for you? Would you like a replacement problem? We make problems. We eat souls. We crap solutions. We are Problem Machine.
This entry was posted in Daily Update, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s