Scroll Button With Ease Effect In As3

I’m italian, so sorry for my english.

I’m working on my new website, and in a section of it I want a scroll button with ease effect.
You can see an example WITHOUT ease effect on the following link:
http://www.chaosmonger.com/chaos08_video.html

Made with this code:


btnUp.addEventListener(MouseEvent.MOUSE_OVER, BUTUP);
btnUp.addEventListener(MouseEvent.MOUSE_OUT, stopBUTUP);
btnDown.addEventListener(MouseEvent.MOUSE_OVER, BUTDOWN);
btnDown.addEventListener(MouseEvent.MOUSE_OUT, stopBUTDOWN);
btnUp.addEventListener(Event.ENTER_FRAME, BUTUP);
btnDown.addEventListener(Event.ENTER_FRAME, BUTDOWN);

contentMain.addEventListener(Event.ENTER_FRAME, skrolldown);
contentMain.addEventListener(Event.ENTER_FRAME, skrollup);

var scrolldown:Boolean=false;
var scrollup:Boolean=false;

import flash.events.Event;

    var scrollHeight:Number = 460;
    var contentHeight:Number = contentMain.height;
    var maskHeight:Number = maskedView.height;
    var initContentPos:Number = contentMain.y;
    var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
    var speed:Number = 5;

    
    function BUTUP(event:MouseEvent):void
    {
        scrollup=true;
    }
        
    function stopBUTUP(event:MouseEvent):void
    {
        scrollup=false;
    }
    
    function skrollup (evt:Event):void
        {
            if(scrollup)
            {
                if (contentMain.y+speed<maskedView.y) {
                    btnDown.visible = true;
                    contentMain.y += speed;}
                else {
                btnUp.visible = false;
                contentMain.y = maskedView.y;}
            }
        }

    function BUTDOWN(event:MouseEvent):void
    {
        scrolldown=true;
    }
    
    function stopBUTDOWN(event:MouseEvent):void
    {
        scrolldown=false;
    }
        
    function skrolldown (evt:Event):void
        {
            if(scrolldown)
            {
                if (contentMain.y-speed>finalContentPos) {
                    btnUp.visible = true;
                    contentMain.y -= speed;}
                else {
                    btnDown.visible = false;
                    contentMain.y = finalContentPos;}
            }
        }
            
    
    
if (contentMain.y==0) {
        btnUp.visible = false;
    }

I have two buttons (btnUp & btnDown), a movieclip that contains all the images (contentMain) and a movieclip as a mask (maskedView).

I need an ease effect when I rollover/rollout or click the mouse, like this:
http://www.animallogic.com/#Our%20Work,Commercials

Can anybody suggest me a code to give an ease effect to buttons, without upset my original code?

THANKS A LOT!

thank you…
I have downloaded the open source ease effect (a list of “.as”: linear, bounce, back, etc.) from your link, but they are dated 2006, before AS3. It works?

Can you show me an example of AS3 CODE to use this class?
Better if based upon my previously code.

THANKS!

:angel:

If you dont want to use the built in tween/easing class in as3, you can use the tweenlite class, which basicly does the same thing.

http://blog.greensock.com/tweenliteas3/

Hope that helps

/rundevo

thanks for suggestion…
but my real problem is WHERE and HOW use the tween on my code… :m:

I don’t want to upset my original code, so if somebody can explain me how use the ease effect or the tween (built in tween/easing, tweenlite, robertpenner, etc.) based upon my code, I’ll be happy!!! :party: