A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Movieclip scrolling to mouse

  1. #1
    the cheesy child bounceboy's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    323

    Movieclip scrolling to mouse

    hello everybody, i have text put into a movieclip ready to scroll ;D

    i've been mucking around for ages and cant get the movieclip to scroll automatically to the mouse.

    heres my script so far:

    onClipEvent(load){
    he = 400;
    top = 0;
    bottom = _height;
    }
    onClipEvent(enterFrame){
    ym = _root._ymouse;
    }

    of course the top of the movieclip is where the text starts.

    basically i want to make it so that the higher the mouse is the faster it moves up until it hits the top, and the lower it is the faster until it hits the bottom.

    I have tried stuff and it hasnt been working so please help out

    Julian

  2. #2
    Junior Member
    Join Date
    Sep 2009
    Posts
    5
    I didn't quite understand what you wanted to do. Do you want to move the text inside a Movie Clip or you want to move the Movie Clip which the text is in?

    Anyway here's a simple way to make a Movie Clip follow the mouse with ease. Increase the easeLevel for smoother ease.

    Code:
    onClipEvent(load){
    	var easeLevel = 10;
    }
    onClipEvent(enterFrame){
    	_y += _ymouse/easeLevel;
    }

  3. #3
    the cheesy child bounceboy's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    323
    hi

    i wanted to move the movieclip to the mouse, i guess i shouldnt have mentioned the text for confusion purposes.

  4. #4
    Junior Member
    Join Date
    Sep 2009
    Posts
    5
    Quote Originally Posted by bounceboy View Post
    i wanted to move the movieclip to the mouse, i guess i shouldnt have mentioned the text for confusion purposes.
    It's cool.

    The previous code that I gave you should do the trick, but it'll only follow in Y-AXIS.

  5. #5
    the cheesy child bounceboy's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    323
    oh yeah sure if i could be bothered i would probably add in x axis later... would be easy now that i have the script =) THANK YOU SO MUCH!

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