View Full Version : Btn to change alpha of other Btn
kingkahuna
07-01-2005, 02:33 AM
I'm trying to script rollOver of one button to change alpha of another named vision_btn. No luck. I tried the MX Help, still no luck. Any ideas?
on (rollOver) {
this.vision_btn._alpha = 50;
}
:confused:
Bufffy
07-01-2005, 07:09 AM
Yay, I get to help someone!!!! I was just playing around with this.
Get 2 movieclips, name them, put them on the stage and then make an action layer and paste this in; hope this is what you had in mind!
------------------------------------------------
mc_circle._alpha = 0;
mc_square.onRollOver = function() {
mc_circle.onEnterFrame = function() {
this._alpha+=2;
if (this._alpha >100) {
delete this.onEnterFrame;
}
}
};
mc_square.onRollOut = function() {
mc_circle.onEnterFrame = function() {
this._alpha-=2;
if (this._alpha <0) {
delete this.onEnterFrame;
}
}
}
kingkahuna
07-02-2005, 07:01 AM
Hi Buffy, thanks for your great script! It faded smoothly and looked just what I was looking for. But I want to attach it to a button to fade another button (called "vision_btn"). I played around with your script (see below) and it works almost -- just the smooth fading in and out doesn't happen. I think the line "delete this.onEnterFrame;" has to be something different. Any more ideas? Thanks again. kk
on (rollOver) {
this.vision_btn._alpha -= 60;
if (this._alpha<0) {
delete this.onEnterFrame;
}
}
on (rollOut) {
this.vision_btn._alpha += 60;
if (this._alpha>100) {
delete this.onEnterFrame;
}
}
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.