Originally Posted by hoydyd
Hi
I recently began learning lua and how to create addons, and have been having trouble with handling children of a ui element. I am trying to call a function on the children of ZO_CompassFrame, and rather than individually calling a function on each child, i thought i would do so through a for loop ( for k,v in pairs(ZO_CompassFrame:getchildren()) do v:function() ). I can use values from a list of numbers such as getdimensions(), however when trying to get the list of children through getchildren(), the game gives the 'expected function instead of nil stack traceback' error. I believe it is something to do with the list containing objects(?), as lists containing strings and integers etc work fine. I am new to lua, so am i just missing something?
Thanks
|
Common to all controls is just GetNumChildren() and GetChild(index)
So, the code from above should be:
Lua Code:
for index = 1, ZO_CompassFrame:GetNumChildren() do
ZO_CompassFrame:GetChild(index):function()
end
You may take a look to Ayantir's super collection of
Dev Tools to see available functions.