Hi All

I'm building a slide out menu.

The requirement is when you mouse over a button it expands
horizontally with a label in it. When you then click it it expands
down with a form inside. If you don't click and mouse out it goes back
to it's initial size.

On the whole this works fine except sometimes when rolling over the
button quickly it doesn't slide all the way back in.

For all of the effects I am using a Tween class. I decided to use a
tween as I need to move and resize the canvas that slides out. This is
because it must expand out to the left so I need to change the x value
to keep the right bound of the button in the same places.

Sometimes it seems the tween will issue call 1 onTweenUpdate call and
then stop with no onTweenEnd call.

I use 1 variable to keep track of all these tweens so before starting
a new tween I can stop the old ones.
I only get problems when re-using this tween variable (never on the
first tween) so I think it must be something to do with the way I stop
the previous tween.

I use this function when I am about to call a new tween:

private function cleanTweens(callLaterFunction:Function):Boolean
{
        if(tweenEffect)
        {
                tweenEffect.stop();
                tweenEffect = null;
                                
                callLater(callLaterFunction);
                                
                return true;
        }
                        
        return false;
}

and call it like this:
private function onClick(e:Event = null):void
{                       
        if(cleanTweens(onClick))return;
        tweenEffect = new
Tween(_horizontalCanvas,_horizontalCanvas.width,expandWidth,effectDuration);
        tweenEffect.easingFunction = _easeOut
}

Is there anything else I should be doing before I start a new Tween?

Any suggestions why this might be happening?

Thanks

Giles.

Reply via email to