View Single Post
  #1  
Unread 10-04-2010, 10:16 PM
SanDBoX's Avatar
SanDBoX SanDBoX is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Location: Idaho
Posts: 40
issue with functions inside of a class

I recently ran across an issue where when I am defining functions inside of a class I can no longer use the "self" identifier such as:
Code:
10   MyWindow = class( Turbine.UI.Window )
11 
12   function MyWindow:Constructor()
13     Turbine.UI.Lotro.Window.Constructor( self ) --this part works fine
14     self.int = 5
15     ...
16   end
17
18   function MyWindow:BronkenFunction()
19     self.int = self.int + 1 
20   end
Oversimplified but should give the right idea, in this kind of an instance I end up getting an "Attempt to index local self (a 'nil' value)" error, and the thing that bugs me the most is I have functions in other files that work just fine and they are written the same way (outside the constructor)

Any idea what it is that I am missing? This really has me lost tonight...
Reply With Quote