FORUMS: list search recent posts

fading a movieclip with next button

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Todd Morgan
fading a movieclip with next button
on Apr 9, 2010 at 8:47:31 pm

I have a scene with three layers (navigation, pages and actions), where each frame has an individual movieclip "page" and the navigation layer is a bar along bottom with back and nect buttons. I have the back and next buttons working whereby when clicked they proceed to frame before or after. What I want to do is add as2 code (WORKING IN FLASH 8) so that when i click either back or next buttons, the current movieclip fades out before gotoandplay the next frame.

Any help please!

Return to posts index

Mike Smith
Re: fading a movieclip with next button
on Apr 10, 2010 at 10:32:31 am

You could try something like this, in a script in your main timeline ..

On load, you could declare variable myCurrentClip and set it to whatever frame/clip you plan to start on, declare a variable myNextClip, and declare a variable myFade, which you set to "no".

In your onEnterFrame function for the main timeline (if you have one, or else in your new onEnterFrame function), you could set up

an if loop which checks the myFade variable and if it == "yes" gets the alpha of the clip in myCurrentClip

and if it is more than 10, fades it by -= 10 (10 per cent) on each enter frame.

If the clip alpha == 0,

it resets myFade to "no", goes to and plays myNextClip, sets myCurrentClip alpha to 100, and resets the myCurrentClip variable to hold the clip name from myNextClip.

The as part of your back and next buttons, you could set myFade to "yes", and myNextClip as where you want to go after the fade ...

Return to posts index

Todd Morgan
Re: fading a movieclip with next button
on Apr 10, 2010 at 11:51:20 am

Thanks... just learning as2, so i will try to figure out how to code this as i have no clue.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved