Results 1 to 4 of 4
Thread: fade in and out effect
-
March 28th, 2007, 07:13 PM #1159Registered User
postsfade in and out effect
I have a few images that I want them to appear fade in while my mouse is over each of them. My question is, do I have to define an proper area to make it work? For now on, it's ONLY work once when I first load my.swf
ps: It won't recognize the area if I first define image1_mc._visible = false; image2_mc._visible = false;
Please help!
Here's my current:
// I don't want them to appear at beginning
image1_mc._alpha = 1;
image2_mc._alpha = 1;
// Fade in while my mouse is on
image1_mc.onRollOver = function() {
this._alpha = 20;
image1_mc.onEnterFrame = function() {
this._alpha += 5;
}
}
// Fade out
image1_mc.onRollOut = function() {
this._visible = false;
}
-
March 28th, 2007, 08:06 PM #21,839Registered User
postsset _alpha to 0 and theyll be invisible but still respond to rollovers and press
the easiest way to set it up would be
// Fade in while my mouse is on
image1_mc.onRollOver = function() {
new mx.transitions.Tween(this,"_alpha",undefined,this. _alpha,100,20)
}
// Fade out
image1_mc.onRollOut = function() {
new mx.transitions.Tween(this,"_alpha",undefined,this. _alpha,0,20)
}
-
March 29th, 2007, 07:49 AM #3159Registered User
postsIt's working great!
Is there a way to do if this image is found while clicking it then it won't do the alpha again, the alpha will only work for the other image
var isFound:Boolean;
// Fade in while my mouse is on
image1_mc.onRollOver = function() {
if(!isFound) {
new mx.transitions.Tween(this,"_alpha",undefined,this. _alpha,100,20)
}
}
// Fade out
image1_mc.onRollOut = function() {
if(!isFound) {
new mx.transitions.Tween(this,"_alpha",undefined,this. _alpha,0,20)
}
}
-
March 29th, 2007, 06:56 PM #4159Registered User
postsnevermind, I found a way to do it!
thanks a lot!

Reply With Quote
Bookmarks