Results 1 to 10 of 10

Thread: x axis control?

  1. #1
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default x axis control?

    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.
    Code:
    onClipEvent (enterFrame) {
    	_y += (_root._ymouse-_y);
    	}

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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?

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    see the navigation here 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

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Have a look at the Object-Oriented Scrollbar tutorials on gotoAndLearn() and see if they don't help you better understand how to do this.

  5. #5
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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.
    Code:
    onClipEvent (enterFrame) {
    	_y += (_root._ymouse-_y);
    	_root.box.y==10;
    }
    box is the name of the movie

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by bluewalrus View Post
    the same place on the x axis
    Quote Originally Posted by bluewalrus View Post
    locked on the y axis
    Which is it?

  7. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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

  8. #8
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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.

  9. #9
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    This is extremely basic (so forgive me if I'm insulting your intelligence) but are you even setting a x coordinate?

    Code:
    _x = 10

  10. The Following User Says Thank You to Medyman For This Useful Post:

    bluewalrus (10-26-2008)

  11. #10
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •