Well in the manual they use a similar code as example for "on_click" however I changed it a bit, now its just for panel1:

Code:

bmap sitbutton ="sitbutton.bmp";
bmap sit = "sit.bmp";

function change_sitbtn(); //prototype, guess this is necessary with "on_click"

panel panel1
{
bmap = sit;
pos_x = 70;
pos_y = 600;
layer = 1;
flags = visible,transparent;
on_click = change_sitbtn;
}

function change_sitbtn()
{
if(panel1.bmap == sit)
{
panel1.bmap = sitbutton;
}
else
{
panel1.bmap = sit;
}
}



EDIT:
just took a look into the manual again, this should work too, according to the manual:
Code:

bmap sitbutton ="sitbutton.bmp";
bmap sit = "sit.bmp";

function change_sitbtn(panel); //prototype

panel panel1
{
bmap = sit;
pos_x = 70;
pos_y = 600;
layer = 1;
flags = visible,transparent;
on_click = change_sitbtn;
}

function change_sitbtn(panel)
{
if(panel.bmap == sit)
{
panel.bmap = sitbutton;
}
else
{
panel.bmap = sit;
}
}



Last edited by Thunder; 09/04/06 09:19.