A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [AS3][CS4]Rollout functions not always working...

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    94

    [AS3][CS4]Rollout functions not always working...

    So, I have these little menu tags which move down when you roll over them. then, if you click one, it stays down. then the other menu tags move down when you roll over them, until you click one, at which point the previous tab moves back to original position. (i'm sure that makes little to no sense... so look here:

    http://www.teaindreamland.co.uk/samples/flash.html

    anyway, it works great for the first couple of seconds, then after a while (especially after a click) some of the menu's don't return to their previous position.

    my fla is attached, but here is my script

    PHP Code:
    //import classes

    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import flash.display.MovieClip;

    //tab controls

    var currentTab:Object dummy;

    tab1.addEventListener(MouseEvent.ROLL_OVERover);
    tab2.addEventListener(MouseEvent.ROLL_OVERover);
    tab3.addEventListener(MouseEvent.ROLL_OVERover);

    tab1.addEventListener(MouseEvent.ROLL_OUTout);
    tab2.addEventListener(MouseEvent.ROLL_OUTout);
    tab3.addEventListener(MouseEvent.ROLL_OUTout);

    tab1.addEventListener(MouseEvent.CLICKselect);
    tab2.addEventListener(MouseEvent.CLICKselect);
    tab3.addEventListener(MouseEvent.CLICKselect);

    function 
    over(evt:MouseEvent):void
    {
        var 
    currentPos evt.target.y;
        var 
    tweenOver = new Tween(evt.target"y"Strong.easeOutcurrentPos00.5true);
    }

    function 
    out(evt:MouseEvent):void
    {
        var 
    currentPos evt.target.y;
        var 
    tweenOut = new Tween(evt.target"y"Strong.easeOutcurrentPos, -230.5true);
    }

    function 
    select(evt:MouseEvent):void
    {
        var 
    currentPos =currentTab.y;
        var 
    tweenOut = new Tween(currentTab"y"Strong.easeOutcurrentPos, -230.5true);
        
    currentTab.addEventListener(MouseEvent.CLICKselect);
        
    currentTab.addEventListener(MouseEvent.ROLL_OVERover);
        
    currentTab.addEventListener(MouseEvent.ROLL_OVERover);
        
    currentTab evt.target;
        
    evt.target.removeEventListener(MouseEvent.CLICKselect);
        
    evt.target.removeEventListener(MouseEvent.ROLL_OUTout);
        
    evt.target.removeEventListener(MouseEvent.ROLL_OVERover);

    Thank you so much Flashkit!!

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    It stops working when you move over it faster. My guess is that is why there are so many different tween class libraries out like caurina for example. The Flash tween class is buggy.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Yep - that's exactly what it is ... your tweens are defined inside the function so they're getting garbage-collected before they complete. Try tweenlite or gtween.

  4. #4
    Member
    Join Date
    Jul 2008
    Posts
    94
    Thanks very much for your input guys... I tried Caurina and it was better, but still not quite there - it had a great tween library though. I think I'll try gtween.

    Thanks again, Dave

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center