Error: Object reference not set to an instance of an object.

Aug 27, 2008 at 7:19 AM
-- Author      : Admin
-- Create Date : 8/27/2008 12:17:30 AM


function Frame1_OnLoad()
    this.RegisterEvent("PLAYER_TARGET_CHANGED");
end

function Frame1_OnEvent()
TakeInboxItem
TakeInboxMoney
TakeInboxTextItem
end

function Button1_OnClick()
    Frame1:Hide();
end


I think it might be compiling wrong because i copied the EXACT code of the hello world tutorial and it didnt work.


and when building solution it gives this error

------ Build started: Project: WowAddon5, Configuration: Default Any CPU ------
Error: Object reference not set to an instance of an object.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

Sep 3, 2008 at 9:12 PM
try changing this.RegisterEvent("PLAYER_TARGET_CHANGED");
to
this:RegisterEvent("PLAYER_TARGET_CHANGED");


Sep 13, 2008 at 10:37 PM
Hi, i also im having the same problem and have made the changes like you said, but i still get the same error.
Oct 14, 2009 at 1:16 PM

Hi, I had the same error however after changing the . to : it is working fine

 

Oct 20, 2009 at 6:35 PM

function Button1_OnClick()
    Frame1:Hide();
end

So thats how you hide frame1 im very new to addons and i wanted to have different frames. I want to have a button close the first frame and open the next so i can separate menus by class. Im trying to write a GM helper for our custom gear. Would it look like this?

function Button1_OnClick()
    Frame1:Hide();
    Frame2:Show();    
end