PDA

View Full Version : [SOLVED]Menu buttons fading effect



MasterBLB
05-30-2011, 03:53 PM
Hi

I'd like to create a fading effect between key frames of a menu created in scaleform.I managed to do so by inserting many keyframes,set manually alpha channel in each one and then use play() function rather than gotoAndPlay("frameID") as Matt Doyle shows in his tutorials.But this works only if I follow the timeline flow,I can't "play reverse" :/
Does anyone have an idea how to solve that?

Matt Doyle
05-31-2011, 10:45 AM
You can't play reverse. You'll have to create an animation going from the menu to the previous menu. And once it gets to that frame, have it jump back to the first frame of the first menu.

rjmyth
05-31-2011, 12:56 PM
or maybe use ._alpha to change it?? a value from 0 (invis) to 100 (vis)

MasterBLB
05-31-2011, 02:40 PM
Yep,it's done by changing the alpha,but the problem was elsewhere.Anyway,I found a solution-if someone would need it,that is it:

function OpenMainMenuScreen()
{
//gotoAndPlay("mainMenu");

fRate = 24; // define frame rate you use for this movie
iTime = 1000/fRate; // maintain same frame rate when playing backward

intBack=setInterval(goBackward,iTime);
}

function goBackward()
{
cf=_root._currentframe;
if (cf>1) _root.prevFrame();
else clearInterval(intBack);
}