A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Constraining Mouse Coordinates

  1. #1
    Member
    Join Date
    Apr 2001
    Posts
    35
    Hi all,

    I have a panorama that scrolls according to the mouse _x value (i'm getting the _x value from a dragged mc).

    everything works great. the only problem is it scrolls when my mouse is not only over the panorma image but anywhere in the swf file. i want to constrict the scrolling to only the area that has the panororama image.

    any suggestions would be helpful.

    thanks!

    mike

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Posts
    515
    if your panorama is a movieclip itself, you can use onClipEvent(mouseOver/mouseOut) actions to determine when the mouse is over it.

    otherwise you can determine the coords of the image and set an if statement like:

    if(_root._xmouse>left && _root._xmouse<right && _root._ymouse>top && _root._ymouse<bottom)

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Posts
    354
    or you can make invisible buttons that set the property of the _x of the movie clip. Just make the buttons cover the area of your movie clip that you want to be panned and set their alpha to 0.

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