Fade in/fade out effect

ok guys i need help
in my movie i have button and when i rollover
over the button , its start contiunosly fade in/fade out effect until i rollout the mouse its have to stop , now i have the script but its works just when i rollover and rollout the mouse and then again i need to rollover again , i searched for this script in forum but didnt find the code for contiunosly effect…
here is my script …this script goes in my actionscript layer :

b1.onRollOver = function() {
_alpha -= 7;

if(_alpha<55)
_alpha = 100;
}

help me please …

try


b1.onRollOver = function() {
     this._alpha -= 7; 

if(_alpha<55)
     this._alpha = 100;
}

lunatic thanks , but its fading out and finally its gone, can this fade out for alpha 55 and fade in agian…

try


b1.onRollOver = function() {
    if((_alpha <= 100) || (_alpha >= 55)){
       this._alpha -= 7;
        }
   else{
        this._alpha = 100;}
}


double check my syntax, I may be missing a () or {} :wink:

This may make the clip jump right to _alpha = 100 once _alpha goes below 55 (i.e. it won’t fade in, just fade out then suddenly 100). If you want it to fade back in then you should +=7 back up to 100.

great…thanks for your time , checked working .,
posible doing this effect by “tell target” ?

your welcome mate :wink:

don’t know too much about tellTarget. Read up on it in reference or post a new thread. Or better yet, do a thorough search THEN post a new thread . . .

:hr:

okey…:wink:

[AS]
b1.onRollOver = function() {
if(!direction){
direction = 1;
}
if((_alpha < 100) || (_alpha >= 55)){
this._alpha += direction * 7;
}
else{
direction = -direction;
}
}
[/AS]

That will make it fade out and then in

Hope it helps,
Shawn

for some reason the code doesnt work , maybe i do some wrong

Eehm … don’t you guys need an onEnterFrame handler somewhere ? Or is it me not understanding the goal ? [size=1]<- Probably that last option here :P[/size]

work your magic here Voets, I don’t have flash available right now to work this out. And you’re right I would need something that was called repeatedly, either enterframe or interval, oh well, sorry tom’s I don’t mean to drop the ball but I just don’t have the time today, if Voets doesn’t have it figured out by tomorrow I will give you a working solution.

And **** Voets born in '88 that makes you like six years younger than me and about 4 times smarter, I love the younger generation, smart so I don’t have to be. :slight_smile:

Uhh… shouldn’t you just tell it to behave as a movie clip? I didn’t read this too thoroughly but that appears to be the problem…

Thanks paradox :slight_smile:

I don’t really get what tom is trying to achieve :stuck_out_tongue:

the effect i want to achieve is a button fadein and fade out
when u roll over and stay with cursor…

when u roll over and stay with cursor… … you want it to fade out or in ?

actually Voetsjoeba i want it to fade in and fade out same time , like here in example but it posible doing this with AS

http://www.kirupa.com/developer/flash5/animatedrollover.htm

That’s not fading in and out, that’s shrinking an growing. It is possible, let me work on an example fla for you.

thanks…Voetsjoeba

Sorry, forgot about this thread :blush:

the script works fine , thank you Voetsjoeba :wink: