Log in

View Full Version : x axis control?



bluewalrus
10-23-2008, 01:04 AM
I have this code and it works 90% of the way i want it to but the movie moves to whereever the mouse is on the x axis i want to limit it 20 like 15 pixels but can't seem to get it to work. Any Ideas? Thanks.

onClipEvent (enterFrame) {
_y += (_root._ymouse-_y);
}

Medyman
10-23-2008, 01:37 AM
Let me try to rephrase what you're looking for because I'm not clear on what you're trying to do.

You want a movieclip to move 20 pixels (or less) from it's original point in the same direction as the mouse?

bluewalrus
10-23-2008, 02:01 AM
see the navigation here (http://www.nike.com/nikeskateboarding/v3/) how it follows the mouse up and down i can get the up and down part but i dont get how to keep it on the same place on the x axis like say on the 21st pixel of x have the block start at. Mine it goes where ever the mouse first enters the movie

Medyman
10-23-2008, 12:48 PM
Have a look at the Object-Oriented Scrollbar tutorials on gotoAndLearn() (http://gotoandlearn.com/) and see if they don't help you better understand how to do this.

bluewalrus
10-23-2008, 01:43 PM
not exactley i want this movie clipped locked on the y axis and to follow the mouse without being clicked i have it scrolling just when it eneters frame it puts it self whereever it is on the y axis. I tried this but it does nothing but this is basically what i want it to be.

onClipEvent (enterFrame) {
_y += (_root._ymouse-_y);
_root.box.y==10;
}

box is the name of the movie

Medyman
10-23-2008, 05:50 PM
the same place on the x axis

locked on the y axis
Which is it?

bluewalrus
10-23-2008, 06:09 PM
Sorry not very good at phrasing what i want. I want it locked at say the 10th pixel of x. I want it to be on that and then go only up and down the y axis never moving on the x even if the mouse moves off the movie. Similiar to a scroll bar but I dont want the mouse to have to be clicked or over for it to move. Here is a link of what my movie does right now. As you'll see if you repostion the mouse and refresh the box is in a different position each time.

http://www.bluewalrus.net/mousefollow.swf

bluewalrus
10-26-2008, 02:36 PM
basically like this i want the movie to do http://www.bluewalrus.net/block.jpg the blue is where i want it to be able to scroll the movie is the exact width of the blue.

Thanks.

Medyman
10-26-2008, 04:03 PM
This is extremely basic (so forgive me if I'm insulting your intelligence) but are you even setting a x coordinate?


_x = 10

bluewalrus
10-26-2008, 10:44 PM
hah yea that was it i wasn't sure if it was in the mouse i had to control or just that but that was it thanks.