Skip to main content
Participant
July 1, 2008
Question

Animated Button Problem with Depths I Think

  • July 1, 2008
  • 1 reply
  • 342 views
I have an animated movieclip ("b1Animated") lying on top of an invisible button ("b1"). When the user mouses over the large invisible button I want the animation to kick in - its a rectangle that grows and changes alpha. It *kinda* works but holding the mouse over the center causes some crazy back and forth because of depth problems, methinks.

Can someone help and have a look?
Appreciate it - Paul

file: http://www.mediafire.com/?e744uux1q3w
code:

import caurina.transitions.*;

//soundEffect in library has linkage "soundEffect"
var soundOnOver:soundEffect= new soundEffect();

//b1 button is invisible
//b1 animButton is the white square that grows and shrinks

this.b1.addEventListener ('mouseOver', function() {
//trying to make sure the invisible buttons remains on top
//addChild(b1);
soundOnOver.play();
Tweener.addTween(b1Animated, {alpha:.9, time:3, transition:"easeOutCirc"});
Tweener.addTween(b1Animated, {scaleX:180, scaleY:220, time:3, transition:"easeOutCirc"});
});

this.b1.addEventListener ('mouseOut', function() {
Tweener.addTween(b1Animated, {alpha:.01, time:1, transition:"easeInCirc"});
Tweener.addTween(b1Animated, {scaleX:1, scaleY:1, time:1, transition:"easeInCirc"});
});



This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 1, 2008
a mouseover is probably eventually triggering a mouseout as b1animated tweens. then the mouseout animation of b1animated is triggered and that triggers a mousever etc.
SteelersAuthor
Participant
July 3, 2008
Yep. My problem was events triggering when I didn't want them to *caused* by a depth problem. My solution was to employ nested movie clips - so the growing box was inside another movie clip container.