I wrote a quick add-on that is triggered by triggers in chat located through strfind and the various CHAT_MSG_* events. When the trigger is used it will change the texture of a frame (I only use the one frame) and display it. All images are 24-bit RLE-compressed .tga images and all display properly within WoW. The issue I am having is that sometimes the texture will get "stuck" and not change.
I had added debugging stuff to make sure that the texture was pathed to the right location and that all arguments are being passed. I know that I didn't follow some good practice like making the frame in XML rather than in the Lua code itself. Below is a pastebin link to the code in question. If anyone has suggestions other than to fix my proposed issue, please let me know. :) Anything that improves this project is a plus in my book. :)
To be able to to use 'f', though, you need to make it local to the entire file. Move line 6 out of the OnLoad function, and remove it (the function), since it's not needed. Now you can use f everywhere, without needing to do getglobal("AddonFrame") (which isn't ideal, anyway).
No offense, but I could go on. :)
Just some friendly advice!
There are many best practices for addon development. The easiest way to learn about them is probably to just post your code and ask for feedback. Otherwise, we could go on forever about good ways and bad ways to do any number of things, many of which may not even be relevant to anything you're trying to do. :p