View Single Post
Old 31st May 2003, 13:04   #1
Joshuatree
Major Dude
 
Joshuatree's Avatar
 
Join Date: Dec 2001
Location: Buffalo NY
Posts: 635
Send a message via AIM to Joshuatree
Finding current mode on player startup

Hey everyone. Been a while since I've posted here. Here's my dilemma. I'm almost finished with my next Winamp 3 skin, but I can't get one thing to work. I need it to find out what mode the player is in on startup, to make the corresponding button active. Here's the code I have so far to try to do this, but it's not working. Can someone please help me to get this to work?
code:
System.onScriptLoaded()
{
main = getContainer("main");
panel = getContainer("panel").getLayout("normal");
mode1 = main.getLayout("mode1");
mode2 = main.getLayout("mode2");
mode3 = main.getLayout("mode3");
mini = main.getLayout("mini");
stick = main.getLayout("stick");
toggleMode1 = panel.findObject("panel.mode1.toggle");
toggleMode2 = panel.findObject("panel.mode2.toggle");
toggleMode3 = panel.findObject("panel.mode3.toggle");
toggleMini = panel.findObject("panel.mini.toggle");
toggleStick = panel.findObject("panel.stick.toggle");

if (mode1.isVisible()) {
toggleMode1.setActivated(true);
}
if (mode2.isVisible()) {
toggleMode2.setActivated(true);
}
if (mode3.isVisible()) {
toggleMode3.setActivated(true);
}
if (mini.isVisible()) {
toggleMini.setActivated(true);
}
if (stick.isVisible()) {
toggleStick.setActivated(true);
}
}

Joshuatree is offline   Reply With Quote