Awesome, thank you so much for that.. so initY is all that was required.. I was wondering though, instead of writing the code as above, would there be any disadvantages of doing it like this:
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.MovieClip;
//record the y values of all the letters
d_mc.initY = d_mc.y;
e_mc.initY = e_mc.y;
s_mc.initY = s_mc.y;
i_mc.initY = i_mc.y;
g_mc.initY = g_mc.y;
n_mc.initY = n_mc.y;
//---DESIGN drops in and bounces---\\
TweenMax.from(d_mc, 2, {y:-200, ease:Bounce.easeOut});
TweenMax.from(e_mc, 2, {y:-200, ease:Bounce.easeOut, delay:.5});
TweenMax.from(s_mc, 2, {y:-200, ease:Bounce.easeOut, delay:1});
TweenMax.from(i_mc, 2, {y:-200, ease:Bounce.easeOut, delay:1.5});
TweenMax.from(g_mc, 2, {y:-200, ease:Bounce.easeOut, delay:2});
TweenMax.from(n_mc, 2, {y:-200, ease:Bounce.easeOut, delay:2.5});
//---DESIGN Mouse RollOvers---\\
addEventListener(MouseEvent.MOUSE_OVER, hover);
function hover(e:MouseEvent):void
{
TweenMax.to(e.target, .5, {y:"30", repeat:-1, yoyo:true});
}
//---DESIGN Mouse RollOuts---\\
addEventListener(MouseEvent.MOUSE_OUT, goBack);
function goBack(e:MouseEvent):void
{
var mc:MovieClip = e.target as MovieClip;
trace(mc.name);
TweenMax.to(mc, .5, { y:mc.initY});
}
It seems to work the same and is about half as much code, but I am wondering if I am going to run into problems when I want to put invisible movie clips above the letters as you specified above, because it only operates on the buttons that triggered the event.
I'm still not sure of the difference between MOUSE_OVER and ROLL_OVER, but this code doesn't work properly with ROLL_OVER, it makes everything on the stage bob.
Haven't had a chance to check your tutorial yet, but will do so now: looking forward to it!
*edit* Actually I have seen that tutorial.. I felt like most of it went over my head at the time (this week is the first time I have done coding of any kind) but I think it is what got started me off on the path that led to the above code! Thanks for your great tutorials, I am going to hunt around for another one.
Also, I was just wondering what is the difference between this:
function goBack(e:MouseEvent):void
{
var mc:MovieClip = e.target as MovieClip;
TweenMax.to(mc, .5, { y:mc.initY});
}
and this:
function goBack(e:MouseEvent):void
{
TweenMax.to(e.target, .5, {y:e.target.initY});
}
?
I don't quite understand var yet, so I am not sure what it is doing in this instance.. off to find more tutes!