Button:
on (rollOver){
this.fade=true;
}
on (rollOut,dragOut){
this.fade=false;
}
However when I attempt to create another button and make it fade in/out fadeBox2_mc i’m unsuccessfull when adding another fade function with fadeBox2_mc to the main timeline. What would be the most efficient way have having multiple buttons control _mc fades? Thanks a ton!
Button:
on (rollOver){
this.fade=true;
}
on (rollOut,dragOut){
this.fade=false;
}
However when I attempt to create another button and make it fade in/out fadeBox2_mc i’m unsuccessfull when adding another fade function with fadeBox2_mc to the main timeline. What would be the most efficient way have having multiple buttons control _mc fades? Thanks a ton!
You should define a variable for each MovieClip, something like this:
[AS]// Frame Actions
fadeMC = function() {
if (this.fade) {
this.nextFrame();
} else {
this.prevFrame();
}
};
fadeBox1_mc.onEnterFrame = fadeMC;
fadeBox2_mc.onEnterFrame = fadeMC;
// Actions for Button controlling fadeBox1_mc
on (rollOver) {
fadeBox1_mc.fade = true;
}
on (rollOut) {
fadeBox1_mc.fade = false;
}
// Actions for Button controlling fadeBox2_mc
on (rollOver) {
fadeBox2_mc.fade = true;
}
on (rollOut) {
fadeBox2_mc.fade = false;
}[/AS]
That should work, I think. =)
You have made me such a happy man! Thanks a ton, worked perfectly!
Just so I can be sure…everything i’ve been learning has been by book and tutorial so i’m sure i’m missing a lot. Can you explain to me exactly how this part works:
fadeMC = function() {
if (this.fade) {
this.nextFrame();
} else {
this.prevFrame();
}
};
fadeBox1_mc.onEnterFrame = fadeMC;
fadeBox2_mc.onEnterFrame = fadeMC;
Basically you’re saying “here is what fadeMC does and these _mc follow that command”?