Forum Moderators: open
Anyone know how this can be done?
They now want the image that fades in to fade out at the same speed when the user hovers over a different button (i.e when the user moves off the first button and effectively kicks off the fade-in procedure on a second button).
In other words, the first image fades out at the same time as the second image fades in.
Not sure if this is possible at all, if there's a quick way of doing this?
onRollOver.image_tween.gotoAndPlay("go")
But I got the following error when trying to play:
**Error** Scene=Scene 1, layer=buttons, frame=1:Line 4: Statement must appear within on handler
onRollOver.image_tween.gotoAndPlay("go"
Create your movie clip that does the fade effect and insert an action stop(); in frame one. At the peak of the fade in add another stop(); action. Then add the fading out sequence. Add a new layer to the movie clip and put the button in there at frame one. Then rt click the button and select actions and put this:
on (rollOver) {
_root.fade_mc.gotoAndPlay("2");
}
(replace "fade_mc" with your movieclip instance name)
Now your fade will stop at 100% opacity and you can move off the button while keeping it visible. So on the other button do the same thing but add another line of AS that says something like
on (rollOver) {
_root.fade_mc.gotoAndPlay("20");
}
(replace "20" with whatever frame comes after the stop(); action to start the fade out sequence.
Added stop(); in Frame 1 (there was already a stop(); in frame 21 (the last one) in order to stop it fading continuously).
Then I added a new layer to the movie clip. I then tried to place the button at frame 1 but immediately I got the message "You cannot place a symbol inside itself".
Presumably this is because the movie clip is already "inside" the button so I can't then put the button onto the movie clip.
Not sure where to go from here?!
I also took out the stop(); at the end of the frames on the movie clip.
I put the following code in Actions for the button:
on (rollOver) {
_root.image_tween.gotoAndPlay("2");
}
Then I got to the bit where on the "other button" I should add the other line of AS. Only problem is, which button? I assumed you meant the other three that I have in the main buttons layer, so I put tyhe following into actions for one of them:
on (rollOver) {
_root.image_tween.gotoAndPlay("20");
}
But I don't see any fade-out for the first button image- in fact it now doesn't work at all (although the others still do).
Might it be easier if I sent you the FLA?!
The other thing is you will probably need a conditional statement to check and see if the image_tween mc is stopped at frame 1 or 19. Otherwise everytime you roll over a button it will show up and fade out regardless of whether or not it was visible before hand.
You said -
"in fact it now doesn't work at all (although the others still do)."
Can you clarify this please?
I'm surprised it seems so difficult to do the fade-out, as I managed to get the fade-in effect sorted with a lot less difficulty.