Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,349 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,124 people online right now. Registration is fast and FREE... Join Now!




Scrolling Icons

 
Reply to this topicStart new topic

Scrolling Icons, looking for something smoother... Maybe Fuse?

bmcc81
post 25 Sep, 2008 - 10:27 AM
Post #1


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 164


My Contributions


Hi,

I wrote this code that isn't the smoothest and I'd like to see if I can get some direction on making this smoother. Maybe using the FuseKit Tween.

Here's my code.
CODE
this.onEnterFrame = function(){
    if (scrollMoviesUp){
        body.scrollingPane.TwoScrollingMovies.scrolling_1._y+=10;
        body.scrollingPane.TwoScrollingMovies.scrolling_2._y+=10;
    }
    if (scrollMoviesDown){
        body.scrollingPane.TwoScrollingMovies.scrolling_1._y-=10;
        body.scrollingPane.TwoScrollingMovies.scrolling_2._y-=10;
    }
    if (body.scrollingPane.TwoScrollingMovies.scrolling_1._y >
        body.scrollingPane.ScrollingPaneMask._y+body.scrollingPane.ScrollingPaneMask._height
        ){
        body.scrollingPane.TwoScrollingMovies.scrolling_1._y =
        body.scrollingPane.TwoScrollingMovies.scrolling_2._y-body.scrollingPane.TwoScrollingMovies.scrolling_1._height-10;
        
    }
    if (body.scrollingPane.TwoScrollingMovies.scrolling_2._y >
        body.scrollingPane.ScrollingPaneMask._y+body.scrollingPane.ScrollingPaneMask._height
        ){
        body.scrollingPane.TwoScrollingMovies.scrolling_2._y =
        body.scrollingPane.TwoScrollingMovies.scrolling_1._y-body.scrollingPane.TwoScrollingMovies.scrolling_2._height-10;
        
    }
    if ( (body.scrollingPane.TwoScrollingMovies.scrolling_1._y +  body.scrollingPane.TwoScrollingMovies.scrolling_1._height) <
        body.scrollingPane.ScrollingPaneMask._y ){
        body.scrollingPane.TwoScrollingMovies.scrolling_1._y =
        body.scrollingPane.TwoScrollingMovies.scrolling_2._y+body.scrollingPane.TwoScrollingMovies.scrolling_2._height+10;
        
    }
    if ( (body.scrollingPane.TwoScrollingMovies.scrolling_2._y + body.scrollingPane.TwoScrollingMovies.scrolling_2._height) <
        body.scrollingPane.ScrollingPaneMask._y    ){
        body.scrollingPane.TwoScrollingMovies.scrolling_2._y =
        body.scrollingPane.TwoScrollingMovies.scrolling_1._y+body.scrollingPane.TwoScrollingMovies.scrolling_1._height+10;
        
    }
}




Can I use something like this?
[code]var scale:Tween = new Tween(body.scrollingPane.TwoScrollingMovies.scrolling_1, "_y", Regular.easeOut, 200, 300, 1, true);

but I don't have the increment thing going on. Does anyone know how I would do this?
Thanks,

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 03:57AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month