Originally Posted by Banknorris
Lua Code:
for i=1, #table, 1 do frames[i]=CreateFrame() frames[i].i=i frames[i]:SetPoint('CENTER', UI, 'CENTER' x, y) frames[i]:SetScript("OnEnter", function() print(self.i) end) frames[i]:SetScript("OnLeave", function() end) end
|
You forgot the self declaration.
Lua Code:
frames[i]:SetScript("OnEnter", function(self)
print(self.i)
end)