Thanks for the responses, but the problem is persisting. I removed the PARENT_NOTIFY and I renamed the event "on MusicSlider", but there was no difference. To be sure that it wasn't my code, I put the code I had in "MusicSlider" into "LeftRelease" and it definitely responds...not correctly, but the response is there.
I guess I'll leave my code, which is really McCoy's code for the most part:
#include "scripts\base.inc"
var sfxSlider; //just to hold some values
var MoveButton; //if true, the button updates its position with the mouse position
sfxSlider.DecimalVolume = (Game.GetGlobalSFXVolume() / 100); //get the sfx volume as a decimal for later (0 - 1)
sfxSlider.CurVolume = Game.GetGlobalSFXVolume(); //get the sfx volume for later (0 - 100)
sfxSlider.MaxXPos = 683; //screen position where slider is at maximum
sfxSlider.MinXPos = 252; //screen position where slider is at minimum
//set the slider's current position to a point on the slider bar that represents the current volume
self.X = sfxSlider.MinXPos + ((sfxSlider.MaxXPos - sfxSlider.MinXPos) * sfxSlider.DecimalVolume);
on "MusicSlider"
{
var parent = self.Parent; //reference to the window that holds the button
MoveButton = true; //the button must update it's position
Game.MouseY = parent.Y + self.Y + (self.Height / 2); //place the cursor in the (vertical) middle of the volume button/ticker
sfxSlider.MouseY = Game.MouseY; //update the mouse position info in the variable
Game.SetMousePos(0,0);
//play the test sound (it's good to hear something while you are increasing or decreasing the volume)
Game.PlaySound("interface\system\sfx.ogg",true);
//loop that updates the mouse position and the volume value
while (MoveButton)
{
//This is needed because the button has relative coordinates (relative to the window) and the mouse
// has absolute coordinates (relative to the screen).
sfxSlider.AbsoluteX = parent.X + self.X; //the absolute Y in the screen of the button.
sfxSlider.AbsoluteY = parent.Y + self.Y; //same for X
//if the button is between the desired limits (in the slider area on the background image)
if(self.X <= sfxSlider.MaxXPos && self.X >= sfxSlider.MinXPos)
{
sfxSlider.oldMouseX = sfxSlider.MouseX; //save the old mouse position to get the difference with the actual position later
sfxSlider.MouseX = Game.MouseX; //save the actual mouse position
//get the difference between the old position and the actual positionand update the button pos. accordingly
self.X = self.X + (sfxSlider.MouseX - sfxSlider.oldMouseX);
//same for the volume value
sfxSlider.DecimalVolume = sfxSlider.DecimalVolume - (sfxSlider.MouseY - sfxSlider.oldMouseY);
}
if(self.X > sfxSlider.MaxXPos) //keep the mouse cursor and the button within limits (right limit)
{
self.X = sfxSlider.MaxXPos;
Game.MouseY = sfxSlider.oldMouseY;
sfxSlider.MouseY = Game.MouseY;
sfxSlider.DecimalVolume = 100;
}
if(self.X < sfxSlider.MinXPos) //same for the left limit
{
self.Y = sfxSlider.MinXPos;
Game.MouseY = sfxSlider.oldMouseY;
sfxSlider.MouseY = Game.MouseY;
sfxSlider.DecimalVolume = 0;
}
//these two ifs keep the mouse cursor between the top and bottom sides of the button/slider
if (Game.MouseY > sfxSlider.AbsoluteY + self.Height - 2)
{
Game.MouseY = sfxSlider.AbsoluteY + self.Height - 2;
}
if (Game.MouseY < sfxSlider.AbsoluteY + 2)
{
Game.MouseY = sfxSlider.AbsoluteX + 2;
}
if (Game.MouseY != sfxSlider.AbsoluteY + (self.Height / 2)) //and this one to keep it in the vertical middle
{
Game.MouseY = sfxSlider.AbsoluteY + (self.Height / 2);
sfxSlider.MouseY = Game.MouseY;
}
Game.SetGlobalSFXVolume(sfxSlider.CurVolume);
Sleep(1); //yeah, maybe too short sleep time, but, hey, this one is the only script running,
}
}
on "LeftRelease"
{
//when the mouse button is released, stop the sound and stop updating
//the button position
Game.StopSound();
MoveButton = false;
}
Any other possibilities?