Ask a Question related to Macromedia Director Basics, Design and Development.
-
Joe Magno webforumsuser@macromedia.com #1
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
-
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... -
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... -
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... -
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... -
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... -
Nathan Friesen #2
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
-
Nathan Friesen #3
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
-
Desmond22 webforumsuser@macromedia.com #4
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
-
Joe Magno webforumsuser@macromedia.com #5
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
-
Desmond22 webforumsuser@macromedia.com #6
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
-
Joe Magno webforumsuser@macromedia.com #7
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
-
Desmond22 webforumsuser@macromedia.com #8
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
-
Joe Magno webforumsuser@macromedia.com #9
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



Reply With Quote

