• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

MovieClip Flickering on MouseOver

Participant ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

I have a card flip animation (actually many card flips) using the greensock Classes.

I have the followig code:

import com.greensock.*;

import com.greensock.easing.*;

flipper.back.rotationY = -90;

flipper.back.alpha=0;

var flipSpeed:Number = .1;

var tl:TimelineMax = new TimelineMax({paused:true});

tl.append(TweenMax.to(flipper.front, flipSpeed, {rotationY:90, visible:false, ease:Linear.easeNone}))

tl.append(TweenMax.to(flipper.back, 0, {alpha:1, immediateRender:false}))

tl.append(TweenMax.to(flipper.back, flipSpeed, {rotationY:0, ease:Linear.easeNone}))

flipper.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);

function onMouseOver(evt:MouseEvent):void {tl.tweenTo(tl.duration);}

flipper.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);

function onMouseOut(evt:MouseEvent):void{tl.tweenTo(0);}

The problem is that there are moments when the mouse is over the Movieclips that the Movieclips flicker (they sort of keep animating) Is there a better way to code this so that I don't get thet MovieClip flicker?

Thanks for any help.

TOPICS
ActionScript

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

What might help is to remove the mouseover event listener in the onMouseOver function and restore it if it needs to be restored in the onMouseOut function

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

Hello Ned:

I put the listener in the MouseOut function but it still flickers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

What you should do is see if you are having a problem where the object is getting stuck in a mouseover / mouseout cycle due to its flipping.  You can do this by putting traces in your functions to see if they are firing repeatedly.  If that is the case, then you may need to hold off assigning the mouseout until after the flip has occured.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

LATEST

Hello Ned:

Ive tried this (putting the function inside the MouseOver function) and it stil flickers:

import com.greensock.*;

import com.greensock.easing.*;

flipper.back.rotationY = -90;

flipper.back.alpha=0;

var flipSpeed:Number = .1;

var tl:TimelineMax = new TimelineMax({paused:true});

tl.append(TweenMax.to(flipper.front, flipSpeed, {rotationY:90, visible:false, ease:Linear.easeNone}))

tl.append(TweenMax.to(flipper.back, 0, {alpha:1, immediateRender:false}))

tl.append(TweenMax.to(flipper.back, flipSpeed, {rotationY:0, ease:Linear.easeNone}))

flipper.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);

function onMouseOver(evt:MouseEvent):void {tl.tweenTo(tl.duration);

flipper.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);

}

function onMouseOut(evt:MouseEvent):void{tl.tweenTo(0);}

Any other suggestions?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines