- Home /
Question by
Avatarus · Sep 24, 2013 at 03:30 PM ·
javascriptvariablefunction
functions file and NullReferenceException: Object reference not set to an instance of an object
Hi I have js script with some common function I would like to use on other function. In other function im adding
var funkcje: funkcje
and then late try to use function from my funkcje file like this
funkcje.startA();
But I still get
NullReferenceException: Object reference not set to an instance of an object
Why? Am I doing something wrong?
Comment
Answer by ArkaneX · Sep 24, 2013 at 03:48 PM
You declared a variable 'funkcje', but you haven't assigned anything to it. Your variable is null. You have to assign a value to it before accessing its members.