to detect when the left mouse key is pressed to reference the vr's timeline to the mouse position. On a macintosh this is not working however...
Any idea how I could do this on a mac? And what about 1, 2, 3 button mice and/or trackpads?
If you want to use the mouse then there are functions already in place that you would have to use. Depending on what you want to happen you can use the mouse. There's onMouseDown();
Example:
There are other ones which you can access through the help menu in flash. It would be in the "ActionScript language Reference"/"ActionScript Classes" and if you go all the way to the M section you would find one that would say mouse. That would give you all you should need to know about the mouse. I don't think that in flash the mouse has an ascii code that can be used. however I've never pursued this and so I don't know if you can use the ascii. I hope that this will help.
Again, thanks for the elaborate answer. The code you suggested seemed logical but didn't work, I think the previous "onClipEvent (mouseDown)" conflicts with the "onMouseDown = function()"...Not sure why yet, but I'm gonna keep trying..
Just use this.
onMouseDown = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
var current_x = _xmouse;
var difference_x = current_x-prev_x;
if (difference_x<0) {
this._parent.cursor.gotoAndStop("left");
} else if (difference_x>0) {
this._parent.cursor.gotoAndStop("right");
}
prev_x = current_x;
frame = (frameRef+Math.floor((_root._xmouse-xRef)/speed))%_totalframes;
if (frame<=0) {
frame = _totalframes+frame;
}
gotoAndStop(frame);
}
}
I don't think that you need them both.
I had to put a different image sequence in there, as the original one is work in progress and belongs to the customer...
I put the original code and the "new" code in there. It's a Flash 8 file.
If you have the time and feel like trying something with the file, that would be great!
Thanks for all your efforts so far!!
PS: I will be gone until Monday, so if I don't respond don't think badly of me ;-)
Perfect!!! Thank you indeed! I had some button symbols floating over the VR, so I had to use what you figured out in a slightly different way, but in the end it worked out just right...