Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
oxbownick #1
rollOver if Mouse Coordinates?help me please!
i want to have a rollOver effect of gotoAndPlay if i rollOver x and y coordinates...
how would i do this, i have the flash mx actionscript bible but i couldn't find what i was looking for, and i've searched for, so if anyone could help me it would be great?
Thanx,
Nick
oxbownick Guest
-
Rollover - mouse over link
I want to build a script that : if mouse over a link(total 4 links inside a big imge) a small image appears differ for each link at the place of the... -
Rollover state remains after mouse moves focus?
I hope I am asking this question in the correct forum. I posted this same question yesterday, but havn't seem to have elisited a response. I have... -
Rollover effect on mouse
H I am making a navigation bar and i want to know when ever someone click mouseover to one of the button I want a white fade going back and... -
Mouse Coordinates -- off .swf
Hi - I'm trying to display mouse coordinates as a design element for my portfolio site. That part is easy enough, but I want to keep tracking the... -
mouse coordinates, help needed.
Helllo to u all, Pronlem: I want to create a flashmovie with the following: Left side: An area (A) in which the mouse can move.... Right... -
kglad webforumsuser@macromedia.com #2
Re: rollOver if Mouse Coordinates?help me please!
use a continual loop to poll the mouse's position (and take appropriate action) or put an invisble button over those coordinates and define a rollover event for the button.
kglad webforumsuser@macromedia.com Guest
-
z00male webforumsuser@macromedia.com #3
Re: rollOver if Mouse Coordinates?help me please!
if (_root._xmouse>0 && _root._xmouse<50 && _root._ymouse>0 && _root._ymouse<50 &&) {
*action here*
-----------------------------------------------------------
this will tell it to do what ever u want when the mouse points over an area between 0 to 50
x & y u can change it to what ever you want! good luck
z00male webforumsuser@macromedia.com Guest
-
oxbownick #4
Re: rollOver if Mouse Coordinates?help me please!
This is what i put pasted:
----------------------------------------------
if (_root._xmouse>0 && _root._xmouse<50 && _root._ymouse>0 && _root._ymouse<50 &&) {
sdapr3.gotoAndPlay (2);
}
-----------------------------------------------
I'm getting these errors:
Symbol=p4, Layer=actions, Frame=1: Line 1: Operator '&&' must be followed by an operand
if (_root._xmouse>0 && _root._xmouse<50 && _root._ymouse>0 && _root._ymouse<50 &&) {
Symbol=p4, Layer=actions, Frame=1: Line 2: ')' expected
sdapr3.gotoAndPlay (2);
Symbol=p4, Layer=actions, Frame=1: Line 3: Unexpected '}' encountered
}
oxbownick Guest
-
exorș webforumsuser@macromedia.com #5
Re: rollOver if Mouse Coordinates?help me please!
hey, you may want to use the "movieClip.getBounds()" code for this one. use it together with the mouse.addListener to find out the coordinate. look up getBounds in the actionscript dictionary. it can be a bit tricky to work with though [well, my experience].
i used it to make a status bar that hides when the mouse isn't near, but pops up when the mouse gets close [like Windows autohide feature =)].
hope that helps.
if you really think about it.... i wouldn't have to!
-Marlon
exorș webforumsuser@macromedia.com Guest
-
oxbownick #6
Re: rollOver if Mouse Coordinates?help me please!
i put this in a new layer named actions, is that right?
oxbownick Guest
-
oxbownick #7
Re: rollOver if Mouse Coordinates?help me please!
I'll look into that, thanx for the help.
Nick
oxbownick Guest
-
z00male webforumsuser@macromedia.com #8
Re: rollOver if Mouse Coordinates?help me please!
sorry this is the right code
if (_root._xmouse>0 && _root._xmouse<50 && _root._ymouse>0 && _root._ymouse<50) {
sdapr3.gotoAndPlay (2);
}
had an extra "&&"
z00male webforumsuser@macromedia.com Guest
-
stwingy webforumsuser@macromedia.com #9
Re: rollOver if Mouse Coordinates?help me please!
I would go along with the original suggestion and create an invisible button or check for mouse coordinates, something like this might work
checkcords = function (X, Y, amount) {
if (Math.abs(X-_xmouse)<=amount && Math.abs(Y-_ymouse)<=amount) {
trace("hello");
// clearInterval(myInterval)
}
};
myInterval = setInterval(checkcords, 50, 400, 500, 50);
Certified but not by Macromedia!
myurl
stwingy webforumsuser@macromedia.com Guest
-
oxbownick #10
Re: rollOver if Mouse Coordinates?help me please!
does that AC go on the button or timeline...also if you would, could ya break that code down for me and explain what each one is and does...you don't have too, I understand a little of it but i am still new to some of this, but it would be greatly helpful if i understood it completely.
thanx,
Nick
oxbownick Guest
-
stwingy webforumsuser@macromedia.com #11
Re: rollOver if Mouse Coordinates?help me please!
The code goes on the timeline, if you give the button an instance name of myButton, you can keep all code together
checkcords = function (X, Y, amount) {
if (Math.abs(X-_xmouse)<=amount && Math.abs(Y-_ymouse)<=amount) {
trace("hello");
// clearInterval(myInterval)
}
};
myButton.onRollOver = function() {
myInterval = setInterval(checkcords, 50, 200, 200, 10);
};
The function checks every 50/1000 secs if you rollOver Xcoord 200,Ycoord 200, +-10. Obviously you can change these values. You really need a way to clearInterval(myInterval) and you might do that in the other frame where you want it to go to.
Certified but not by Macromedia!
myurl
stwingy webforumsuser@macromedia.com Guest



Reply With Quote

