Alright so I'm working on making a skill calculator for this a game. This one I am working on right now has multiple skill calculators in a single flash file, but for some reason that I can't figure out, the skill calculator won't actually calculate. Here is a pastebin length to the AS code
Alright, I apoligize for its length, but I really have no idea what I'm doing wrong with this one. Here is the output:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at allInOneCalc_fla::MainTimeline/changeCalc()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.controls::ComboBox/onListChange()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.controls::SelectableList/handleCellRendererClick()
I get that error the second I select a calc and it goes to that frame, and when I input all the information it gives me a "0 and whatever text I had it add" for the answer. Please help, I've been stuck on this for a while.
EDIT: I Believe I did the wrong type of event for lines 22, 25 but I'm still not sure with what type of event I should use. Any advice is greatly appreciated
I'm gonna come right out and say it: Ever heard of arrays and loops?
Now that that's done with, are you developing in Flash CS3/4/5 (doesn't matter). If you are, have you tried running this in debug mode (ctrl + shift + enter)? If you haven't, do that and replicate the error. It will tell you the exact line that this error is occurring at. Then maybe you can figure out why whatever variable it's using is null.
Yeah, I started messing around with flash like a week and a half ago, so I don't really know what I'm doing. I'm doing it with CS5.5 and debug mode says line 10 which is different since the code changed since I added a loading bar. Here is a code snippet.
I am also getting this error contiuously repeating since I added the loading bar.
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at allInOneCalc_fla::MainTimeline/loading()
Anything I'm doing wrong or even unnecessary would be awesome if you pointed it out to me. I'm still trying to learn and this is the first object styled coding language I've ever tried to learn. I am still not sure of the problem.
You can run it in debug mode, cause the error, and when the program stops and shows you the line, go to Window -> Debug Panels -> Variables. This shows you all the variables and their values. You can check which variable in that line is null through the Variables window.
It says that bar_mc is null, and a whole bunch others, yet bar_mc since I defined it as an instance on my stage. Am I misunderstanding how I should do this?
Also certain variables I am not even using are nulled, such as the first 2 in that last screenshot. It would be much appreciated if someone could explain to me what I am doing wrong and what I don't understand about variables. Thanks.
Well I'm quite familiar to HTML and CSS. I know that XML is supposed to be similar. I'm not sure if that would fix my problem but if it would I'm definitely open to it.