vertical scrolling pointer following cursor

Ask a Question related to Macromedia Director Basics, Design and Development.

  1. #1

    Default vertical scrolling pointer following cursor

    Hi!
    Does anyone know how to do a vertical scrolling pointer following the cursor up and down?
    I've tried a couple tricks using vector motion and others, but I cannot reach the event...
    What I want to do is a little arrow on the left of a menu that moves vertically following the cursor.

    Thanks in advance, bros.


    Joe Magno webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Only Vertical Scrolling at Table
      Hello, I need some help concerning to the code below. I have a small table confugured to scroll text, but something is lacking in the code to...
    2. Repeating region inside a vertical scrolling window
      Hello All, I have a webpage that has a user form and beside that form is a repeating region. Is it possible to have a repeating region inside a...
    3. Mouse pointer flickers between hand and pointer
      I have created a menu. On the menu options for some reason my mouse pointer flickers between a hand and pointer. Did anyone have this problem and...
    4. Cursor Controlled Menu Scrolling
      My knowledge of ActionScript is VERY basic at this point but I need to learn how to do a cursor controlled scrolling menu. I am currently referring...
    5. Vertical scrolling layer
      I need some help in creating a vertical scrolling layer. I've successfully used PVII's free extension for DW4, but I need to tweak it a bit and don't...
  3. #2

    Default Re: vertical scrolling pointer following cursor

    You can do:

    on mouseDown
    repeat while the stillDown -- TRUE while the button is pressed
    -- move your sprite vertically to the new mouse vertical position
    -- do anything else you want to change related to the new mouse/sprite position
    updateStage -- This must be done to show the changes
    end repeat
    end mouseDown


    This will keep the item moving while the mouse is down. You can also add logic to keep it from moving above or below a certain area. The downside is that no other scripts can run while you're in the repeat loop, so no other buttons will have rollovers or anything like that until the mouse button is released.

    Let me know if that is what you're looking for, and if it helps. Thanks

    Nathan
    Nathan Friesen Guest

  4. #3

    Default Re: vertical scrolling pointer following cursor

    I don't think everything loaded for me on the example page, so I wasn't able to see what you're looking at. If you want the image to start following the cursor on when the mouse enters the image, you can set a property on mouseEnter, and then on exitFrame if the property is set move the image to the mouse position. For example:


    property pFollowMouse



    on beginSprite
    pFollowMouse = FALSE -- the image shouldn't be following the mouse yet
    end beginSprite


    on mouseEnter
    pFollowMouse = TRUE
    end mouseEnter



    on exitFrame
    if pFollowMouse then
    -- move the image to the new mouse location
    end if
    end exitFrame


    This will keep moving the image until you change the flag back to FALSE (on click, or another event)

    Let me know if this is more what you were looking for. Sorry if I'm still not getting it.

    Nathan
    Nathan Friesen Guest

  5. #4

    Default Re: vertical scrolling pointer following cursor

    I missed a bit last time!!...


    1.if you want it only to work when the mouse is in a particular part of the screen, you could use on mouse enter and place a dummy transparent sprite over all your buttons.
    If your buttons are all down the left side of your screen you could simply have:

    On exitframe me
    If the mouseh<100 (or whatever) then
    This.locv=This.locv+(the mousev-This.locv)/5
    End if
    End

    You could also solve the problem using rect() and check for intersections using intersect() ... its all in the help file:]

    Des



    Desmond22 webforumsuser@macromedia.com Guest

  6. #5

    Default Re: vertical scrolling pointer following cursor

    Something is not right into that fixing space script. Some different errors when I try to solve it...
    Let me know if you have the key (I'm not very into lingo, bro)

    zombie creepin'
    Joe Magno webforumsuser@macromedia.com Guest

  7. #6

    Default Re: vertical scrolling pointer following cursor

    Hi,

    I?m not sure what you mean by fixing space. If you mean you want the arrow to move only when the cursor is over a particular area, then there are several ways of doing it.

    The easiest is this:

    Property this

    On beginsprite me
    This=sprite(me.spritenum)
    End

    On exitframe me
    if the mouseh < 100 and the mousev < 200 then
    This.locv=This.locv+(the mousev-This.locv)/5
    end if
    End

    This will restrict the active area to a rectangle 100 wide and 200 high at the top left of the screen. You can abviously define this yourself by changing the values. Using > you can also shift it to the bottom of the screen or right of the screen.

    If you want your buttons in a rectangle in the centre of the screen it?s a bit more complicated. I?ve attached a solution that uses a ?dummy? sprite that covers the whole area that you want to be active, set this sprites blend to 0. If there is a rollover it sets an arrowflag to be true. If the arrow flag is true then the handler above works.

    If theres any probs let me know?

    Des


    [url]http://webforums.macromedia.com/attachments/arrowthing.zip[/url]


    Desmond22 webforumsuser@macromedia.com Guest

  8. #7

    Default Re: vertical scrolling pointer following cursor

    Hi there!!
    Ok. Now it's done, but I want to do anything else and I think it's easy. I've been trying but I cannot get it right.
    The thing is to put the "following-pointer" on a specific place when the cursor leaves the zone where I want it to act.

    I tried to use the same script changing things, but seems like I commit a mistake somewhere I cannot see ('coz it's not a script error...)

    Let me know!!

    zombie creepin'
    Joe Magno webforumsuser@macromedia.com Guest

  9. #8

    Default Re: vertical scrolling pointer following cursor

    When do you want to reset the position of the following pointer?
    You want to reset it when the mouse is not in the dummy box, ie at the same time as you set arrowflag to false

    behaviour for the dummy:

    global arrowflag

    on exitframe me
    if rollover (me.spritenum) then
    arrowflag=true
    else
    sprite(2).locv=20 ? or whatever
    arrowflag=false
    end if
    end

    Des




    Desmond22 webforumsuser@macromedia.com Guest

  10. #9

    Default Re: vertical scrolling pointer following cursor

    Hi Des,
    well, this doesn't work right at all...
    What i made with your old script is:
    On exitframe me
    If the mouseh>150 and the mouseh<464 and the mousev> 108 and the mousev<362 then
    This.locv=This.locv+(the mousev-This.locv)
    End if
    End

    That creates the square zone where I want the "follower" acting.
    Now, I want the follower to come back to the top (for example) when the cursor is out of that square zone.

    zombie creepin'
    Joe Magno webforumsuser@macromedia.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139