Jump to content
GreenSock

Vaidokas

Members
  • Posts

    4
  • Joined

  • Last visited

Vaidokas's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. 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
  2. Great! Thank you very much. What i was doing wrong - circle1 and circle2 were button objects and text1 and text2 were MovieClips, converting circles to MovieClip type solved the error.
  3. Wow, thanks for the reply. If i correctly understand from your code text objects should be a property of circle buttons. I'm only using Flash CS5 so tried to apply your code in my file and i get error: 1109 Access of possible undefined property text_mc.... If you could resave to CS5 maybe i could figure out what i'm doing wrong. Or take a look at my file. Thank you! vaidokas-rollovers.fla.zip
  4. Hello all, I have many buttons (instance names: circle1, circle2, etc) with many text objects besides those buttons (instance names: text1, text2, etc) that should animate when rolling over/out those buttons. I'm trying to create event listeners that pass variable "text1" to "OverCircle"/"OurCircle" functions when rolling over/out "circle1" and so on. Not sure what i'm doing wrong: import com.greensock.*; import com.greensock.easing.*; import flash.events.MouseEvent; function OverCircle(e:MouseEvent, Text:Object):void { TweenLite.to(Text, 0.5, {alpha:100}); } function OutCircle(e:MouseEvent, Text:Object):void { TweenLite.to(Text, 0.2, {alpha:0}); } circle1.addEventListener(MouseEvent.ROLL_OVER, OverCircle(text1)); circle1.addEventListener(MouseEvent.ROLL_OUT, OutCircle(text1)); circle2.addEventListener(MouseEvent.ROLL_OVER, OverCircle(text2)); circle2.addEventListener(MouseEvent.ROLL_OUT, OutCircle(text2)); Any help would be appreaciated!
×