How would you go about using a function to change button format in one place? I think the function needs to identify which button called it instead of using "this"?
Currently I put code in each buttons events see below for a sample.
LP.Pg3.PgBody.rowSFrmLP.sfrmBtn.Remove::mouseEnter - (JavaScript, client)
// set caption to red and underlined
this.caption.font.underline = "1";
this.caption.font.fill.color.value = "255,0,0";
LP.Pg3.PgBody.rowSFrmLP.sfrmBtn.Remove::mouseExit - (JavaScript, client)
// set caption to black and no underline
this.caption.font.underline = "0";
this.caption.font.fill.color.value = "0,0,0";
I would like to do something like the following code assigned each button to make it easier to maintain and I could simply change the function to change all the buttons formatting at once.
function fMouseIn()
{
// set caption to red and underlined
this.caption.font.underline = "1";
this.caption.font.fill.color.value = "255,0,0";
}
function fMouseOut()
{
// set caption to black and no underline
this.caption.font.underline = "0";
this.caption.font.fill.color.value = "0,0,0";
}
LP.Pg3.PgBody.rowSFrmLP.sfrmBtn.Remove::mouseEnter - (JavaScript, client)
sFrm.MouseIn();
LP.Pg3.PgBody.rowSFrmLP.sfrmBtn.Remove::mouseExit - (JavaScript, client)
sFrm.MouseOut();