Well, while I did figure out THAT problem, I'm now having another one that does seem to be related to SetStateValue.
Basically what's going on is this. I have 4 windows on this particular skin: SongInfo, Vol, Pos, and Playlist.
Now.... Playlist and SongInfo cannot be shown together. Pos & Vol both should ONLY show up along with SongInfo, and neither Pos & Vol can be shown at the same time.
So let's say I have SongInfo and Pos shown. I then switch to Playlist. So I hide SongInfo and Pos, and show Playlist. Now when I come back from Playlist, I know I'm coming back to SongInfo, but I need some way of determining if I need to also show Pos or Vol. The way I've been trying to keep track of which one of those two is "on" was at first by using SetStateValue, but since I was getting mixed results using that, I switched to just a global variable that would store that info while the skin was active. Then I would just use SetStateValue to store the value of that variable when the skin exited, so that I could read it back when the skin starts so I can set everything back to the way it was when you left.
The problem is, I noticed that sometimes SetStateValue is recording a value of "Global" instead of "Pos" or "Vol". What I can't understand is where it's getting the value of "Global" from. I have to functions, ShowPos and ShowVol that do just what they say, and when they do it, they set the value for that global variable. So when ShowPos fires it also sets the value of PosVol (the global variable) to "Pos" and when ShowVol fires it sets PosVol to "Vol". So right there, as long as one of these two functions has fired during the running of this skin, PosVol should be either "Pos" or "Vol".
Now, in my OnInitialize function, I have assign PosVol the value that GetStateValue retrieves from state.xml. So there should never be a time when this variable has an undefined value. And yet it still winds up with this "Global" value from time to time.
Any ideas just from listening to me? Probably not, I'm sure, so if you need me to, I'll post a link to my main.js for you to look over... actually, I'll do that anyway.