PDA

View Full Version : How does one make an inertia scroll like in the BombShock award site XM2?



2hitek
September 22nd, 2003, 02:19 PM
I have the basic code down for doing this particular kind of controlled inertia scroll but it does not work properly. When you go to:

http://xm2.com/xm6/

Go to the main "home" section and look at the bottom where it has the little icons of documents. When the user slowly hovers over that MC, it scrolls gently with a nice inerita feel towards the left and right depending on which direction you move with the mouse. I have it just about done but no cigar. Please let me know how to do this because I seriously tried for 2 hours today trying to figure it out before asking help here. Thanks for the help.

I understand that all the documents are basically buttons which are in a movieclip. That movieclip is inside another movieclip which is on the main stage. The script is manipulating the movieclip with the buttons inside of it based on the _x position of the user when they move over the MC that has everything inside of it. I just cannot figure out that code which does it...and that too..with the nice inertia feel to it.

-Ninu

__________________
flash@ninu.net

[ArcanE]
September 22nd, 2003, 03:23 PM
I can't really help out cuz i'm a flash naab but i just wanna point out i got a browser timeout at that url, u might wanna put WWW before the url.

http://www.xm2.com/xm6 :)

Edit: Bleh, it seems to work fine now, dunno if its related to browser caching or not. If the link works just call me a geek :)

dizknee
September 23rd, 2003, 09:20 AM
Geek :P

m_andrews808
September 23rd, 2003, 09:31 AM
you can create that knid of motion pretty easily:



this.onEnterFrame = function() {
MovieClip._x += (TargetX - MovieClip._x) / 10;
}


TargetX is the x coordinate of where you want MovieClip to move to, so in your example TargetX would be defined by the mouse's x coordinate. The number 10 at the end defines the amount of deceleration, the higher the number, the longer it'll take the clip to get to its target location.

let me know how you get on