However, the project got more complicated: there will be Circle, on which rollover a header appears, on header's rollover - a text block below header appears:
Basically i'm doing the same way - assigning the head as circle's child, and txt - as head's child.
I'm not sure tho that i'm doing right with .mouseOver property. And not sure how to select e.currentTarget's parent for setting it as a variable in OverHead function.
import com.greensock.*;
circle01.head = head01;
circle01.head.txt = txt01;
// head's roll over disabled untill circle is rolled over
circle01.head.mouseEnabled = false;
// txt's roll over disabled untill head is rolled over
circle01.head.txt.mouseEnabled = false;
//need a property for head and txt to know if mouse is over them
circle01.head.mouseOver = false;
circle01.head.txt.mouseOver = false;
//head animating on circle rollover
circle01.addEventListener(MouseEvent.ROLL_OVER, OverCircle);
circle01.addEventListener(MouseEvent.ROLL_OUT, OutCircle);
function OverCircle(e:MouseEvent):void
{
var circle = e.currentTarget;
circle.head.mouseEnabled = true;
trace("Head rollover enabled\n");
TweenLite.to(circle.head, 0.3, {alpha:1});
}
function OutCircle(e:MouseEvent):void
{
var circle = e.currentTarget;
trace("Head rollover enabled = " + circle.head.mouseOver + "\nTXT rollover enabled = " + circle.head.txt.mouseOver + "\n");
if (circle.head.mouseOver == false || circle.head.txt.mouseOver == false)
{
TweenLite.to([circle.head, circle.head.txt], 0.0, {alpha:0});
circle.head.mouseEnabled = false;
circle.head.txt.mouseEnabled = false;
}
}
//txt animating on head rollover
circle01.head.addEventListener(MouseEvent.ROLL_OVER, OverHead);
function OverHead(e:MouseEvent):void
{
//need to set e.currentTarget's parent as circle var, the line below doesn't do that
var circle = e.currentTarget;
circle.head.txt.mouseEnabled = true;
TweenLite.to(circle.head.txt, 0.3, {alpha:1});
}
vaidokas-rollovers.fla.zip