I got it I got it I got it I got it. It works. WOOO. ahem. Anyway, this is the code I used.
on (release) {
mpconduit._alpha = 100;
mpconduit.onEnterFrame = function(){
mpconduit._alpha--;
mpconduit._alpha < 0 ? delete mpconduit.onEnterFrame : null;
}
}
mpconduit is a movie clip so I could name it, even though it's really just a graphic. It works. Now, a question. mpconduit._alpha-- increments the alpha by 1 per frame. How can I alter this to change it by 5? I mean, I could do
mpconduit._alpha--;
mpconduit._alpha--;
mpconduit._alpha--;
mpconduit._alpha--;
mpconduit._alpha--;
but that's ugly and there must be a better way. Also, ahem, there's like alot of elements in these buttons, not just one. Is there any way to lump them together under one expressoin?
Below I'm posting the entire contents of the button. It's long.
on (release) {
mpconduit._alpha = 100;
mpconduit.onEnterFrame = function(){
mpconduit._alpha--;
mpconduit._alpha < 0 ? delete mpconduit.onEnterFrame : null;
}
mpwalls._alpha = 100;
mpwalls.onEnterFrame = function(){
mpwalls._alpha_alpha--;
mpwalls._alpha < 0 ? delete mpwalls.onEnterFrame : null;
}
mpname._alpha = 100;
mpname.onEnterFrame = function(){
mpname._alpha--;
mpname._alpha < 0 ? delete mpname.onEnterFrame : null;
}
background._alpha = 0;
background.onEnterFrame = function(){
background._alpha++;
background._alpha > 100 ? delete background.onEnterFrame : null;
}
portaname._alpha = 100;
portaname.onEnterFrame = function(){
portaname._alpha--;
portaname._alpha < 0 ? delete portaname.onEnterFrame : null;
}
portawalls._alpha = 100;
portawalls.onEnterFrame = function(){
portawalls._alpha--;
portawalls._alpha < 0 ? delete portawalls.onEnterFrame : null;
}
portaconduit._alpha = 100;
portaconduit.onEnterFrame = function(){
portaconduit._alpha--;
portaconduit._alpha < 0 ? delete portaconduit.onEnterFrame : null;
}
bldganame._alpha = 100;
bldganame.onEnterFrame = function(){
bldganame._alpha--;
bldganame._alpha < 0 ? delete bldganame.onEnterFrame : null;
}
bldgaconduit._alpha = 100;
bldgaconduit.onEnterFrame = function(){
bldgaconduit._alpha--;
bldgaconduit._alpha < 0 ? delete bldgaconduit.onEnterFrame : null;
}
bldgawalls._alpha = 100;
bldgawalls.onEnterFrame = function(){
bldgawalls._alpha--;
bldgawalls._alpha < 0 ? delete bldgawalls.onEnterFrame : null;
}
bldgawname._alpha = 100;
bldgawname.onEnterFrame = function(){
bldgawname._alpha--;
bldgawname._alpha < 0 ? delete bldgawname.onEnterFrame : null;
}
bldgawwalls._alpha = 100;
bldgawwalls.onEnterFrame = function(){
bldgawwalls._alpha--;
bldgawwalls._alpha < 0 ? delete bldgawwalls.onEnterFrame : null;
}
}