Apr 20, 2009 at 5:19 AM
Edited Apr 20, 2009 at 5:35 AM
I know, I know, Im a big noob. I am atempting to create an addon by following the steps in Chapter 14 of "World of Warcraft Programming". I'm having trouble with the code in the lua. The frame loads just fine and I can close the frame using the button but the onload function is returing an error when the addon loads and for the life of me I don't see why. This is the code

 function helloWordFrame_OnLoad()
    frame:RegisterEvent("PLAYER_TARGET_CHANGED"); -- this is line 5

function helloWordFrame_OnEvent()
      if (event == "PLAYER_TARGET_CHANGED") then
              if UnitExists("target") then
                   addonMessage:SetText("Hello " .. UnitName("target") .. "!");

function closeButton_OnClick()

the error I'm getting is:
 Error: attempt to index local 'frame' (a nil value)

Apr 21, 2009 at 3:34 AM
How about this:

function helloWordFrame_OnLoad()
    self:RegisterEvent("PLAYER_TARGET_CHANGED"); -- this is line 5

Note, frame: to self: ?
May 30, 2009 at 8:24 PM

I had the same damn problem.  I am finding that the book is a big waste of cash.  It is peraching to noobs, but how are we supposed to know the difference between an error made trying to copy the book or an error in the book.

Aug 16, 2009 at 6:13 PM

You have to make a frame, make sure it's selected, then open theproperties widow, at the botton of the list it should say "Frame1" in one feild at the botton, click on it and name it "helloWorldFrame"



make sure you have al components needed in your addon