Frame:SetScript() Not Working?
I am about to lose my mind with this issue. I've done it a million different ways, but cannot for the life of me get this to work.
I'm simply trying to create an invisible frame, subscribe it to a few events and print those events when they fire. Addon.toc Code:
## Interface: 90200 Lua Code:
|
You don't need to set the OnLoad script, that's only applicable when your frame is defined in XML
Lua Code:
|
Wow, that fixed it. Thank you!
Can you add any information as to why this was breaking my script? Like is the "OnLoad" script of AddonParent not even getting called if it's not defined in XML? I tried to do this with XML at first, but I kept getting an error like "method AddonParent_OnLoad not found in element OnLoad" for an XML like this. Code:
<Ui> Lua Code:
|
The method attribute is used if the script is a method of the frame (usually added to the frame via a mixin attribute included in the <Frame ...> tag).
Because your function is a global (and so long as the .lua file is listed in the .toc before the xml file) you would just call the function: Lua Code:
|
That makes a lot of sense. I was using sArena as a reference and they have a mixin defined in their frame tag. Since I had the other attributes of the frame tag removed (except for name), it didn't know what to do. Thank you both!
|
All times are GMT -6. The time now is 09:44 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI