I declared the folowing fuction for the onRollOver -and onRollOut state of three buttons:
[AS]this.onEnterFrame=function(){
for (var i in this){
if (this*.name.substr(0, 6) == "sound")
{
this*.onRollOver = function() {
new Color(this).setRGB(0xCCCCCC);
}
this*.onRollOut = function()
{
new Color(this).setRGB(0xA4Ae8B);
}
}
}
}
[/AS]
I also want to add an onRelease state wich overwrite the onRollOver -and onRollOut part of the function and set the new Color to (0XFFFFFF) and start a new song. The first part of the function should work again when one of the other two buttons is pressed.
I tried it by adding the following code, but it isn’t working:
[AS]this*.onRelease = function() {
delete this*.onRollOver;
delete this*.onRollOut;
new Color(this).setRGB(0xFFFFFF);
}[/AS]
What am I doing wrong?