00:00
00:00
Newgrounds Background Image Theme

markololohands just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Error: Variable not defined

553 Views | 7 Replies
New Topic Respond to this Topic

Error: Variable not defined 2016-02-20 21:42:44


I've been driven crazy by how this error seemingly came out of the blue. What happens is that I've got a bunch of TextInputs in various classes, either as part of other components (inside Comboboxes, for example) or on their own; these are all throwing errors for no apparent reason at all.

According to the debugger the reason is because the textinput's background is null, and then from there on whenever it is drawn, updated or validated (don't know which), it used getDefinitionByName() which then throws the error.

The problem is that as far as I know there's no property on TextInput such as background; there's only opaqueBackground. Setting that to a number does not do anything either.

What do I do next? Do I try replacing all comboboxes and textinputs with some other components (a rather huge task), or is there something else?


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to Error: Variable not defined 2016-03-01 10:50:31


Never mind, the error was fixed.

/denvercoder9

In all seriousness, I have no idea what caused the error and what fixed it either. The only indication was that it was due to something in getDefinitionByName in fl.controls::TextInput/drawBackground. The fix? Building in release mode instead of debug mode. It's not a fix because I can't use the debugger anymore, but at least it's not due to a problem in the source code, anyways.

Maybe it's due to me using the AIR 20 Beta and not the stable? I'll try updating AIR SDK and FlashDevelop and seeing if the problem goes away on its own. If not, oh well I guess it's testing time in release mode for me then.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to Error: Variable not defined 2016-03-02 03:17:19


At 3/1/16 10:50 AM, Gimmick wrote:
/denvercoder9

Something clicked deep in the back of my mind. Was that an XKCD reference?


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to Error: Variable not defined 2016-03-02 07:31:49


At 3/2/16 03:17 AM, egg82 wrote:
At 3/1/16 10:50 AM, Gimmick wrote:
/denvercoder9
Something clicked deep in the back of my mind. Was that an XKCD reference?

Yep.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to Error: Variable not defined 2016-03-05 09:29:06


Nope! The error did not get resolved when upgrading flashdevelop and air sdk. The issue does not appear in release, but it still does in debug as it used to before. What gives?

I guess the new question should be: What alternative to flash components (that I can use in AS3) do you know of?


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

I use Feathers UI, but Flash's components shouldn't be giving you issues. Check your code again and use debugging tools. You should be able to step backwards through your code when an error happens to the point everything went wrong (and before)


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to Error: Variable not defined 2016-03-09 10:10:49


At 3/6/16 02:15 PM, egg82 wrote: I use Feathers UI, but Flash's components shouldn't be giving you issues. Check your code again and use debugging tools. You should be able to step backwards through your code when an error happens to the point everything went wrong (and before)

Well...all I can ascertain from the debugger is that it occurs after a RENDER event, at which point the UIComponent's callLaterDispatcher redraws all the components and then the drawBackground is called, but the background is null, so getDefinitionByName fails.

Commenting out functions one by one reveals that it doesn't occur directly after the render event - the event doesn't need to fire, just the UIComponent callLaterDispatcher has to - and then it occurs. Nothing in the code points to that, apart from initializing the things. I removed all styles and the problem is still there.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to Error: Variable not defined 2016-03-09 11:28:02


Well, I found a workaround. The problem only occurred in classes with ComboBoxes, and because of them. If I remove the ComboBoxes, everything works fine. Not ideal, but I suppose it is preferable to replacing the components entirely...


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature