We investigated this recently. We found the easiest thing to do was
create the drag interaction on a clip which has the standard horizontal
orientation, and then rotate that clip. Constraining it to a sloped
line was possible, but very tough to get smooth.
Jason Merrill
Bank of America
So y=mx+c doesn't give good results?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Merrill, Jason
Sent: 05 January 2007 15:42
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Drag on a specific angle
We investigated this recently
list
Subject: RE: [Flashcoders] Drag on a specific angle
So y=mx+c doesn't give good results?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Merrill, Jason
Sent: 05 January 2007 15:42
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Drag
: [Flashcoders] Drag on a specific angle
We investigated this recently. We found the easiest thing to
do was create the drag interaction on a clip which has the
standard horizontal orientation, and then rotate that clip.
Constraining it to a sloped line was possible, but very tough
to get
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Drag on a specific angle
So y=mx+c doesn't give good results?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Merrill, Jason
Sent: 05 January 2007 15:42
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Drag
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Drag on a specific angle
We investigated this recently. We found the easiest thing to
do was create the drag interaction on a clip which has the
standard horizontal orientation, and then rotate that clip.
Constraining
] On Behalf
Of [EMAIL PROTECTED]
Sent: Friday, January 05, 2007 11:16 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Drag on a specific angle
Much like y = mx + b when determining the slope of a line. I
think that was algebra... :)
- Original Message -
From: Merrill, Jason
Much like y = mx + b when determining the slope of a line. I
think that was algebra... :)
Exactly - except we always did mx+c at school
To put it in laymens terms on a standard graph the eqn for a slope of
line is:
y=mx+c
where
y=y value
m=gradient of line
x=x value
c=intersect of line on
Sent: 05 January 2007 15:42
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Drag on a specific angle
We investigated this recently. We found the easiest thing to
do was create the drag interaction on a clip which has the
standard horizontal orientation, and then rotate that clip
OK this is untested but:
[as]
function limitToSlope(mc, grad, start, end) {
if(_xmousestart.x _xmouseend.x){
mc._y = grad*_xmouse+start.y;
mc._x=_xmouse
}
}
function drag(){
start=new Object()
start.x=point1._x
start.y=point1._y;
AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Drag on a specific angle
You can project a perpendicular line from the mouse to the
target line and then find the intersection.
Stick the movieclip there. bingo.
Merrill, Jason wrote:
But he's talking about constraining a movie clip
Tested, slight change:
[as]
function limitToSlope(mc, grad, start, end) {
if(_xmousestart.x _xmouseend.x){
mc._y = (grad*(_xmouse-start.x))+start.y;
mc._x=_xmouse
}
}
function drag(){
start=new Object()
start.x=point1._x
start.y=point1._y;
Merrill, Jason wrote:
You can project a perpendicular line from the mouse to the
target line and then find the intersection.
uh huh. Still waiting for someone to explain how to do the constrain
part. Mike did say, Using this basic principle you could limit an MC
to a slope based on the
I did something similar awhile back for a site with a diagonal
scrollbar.
First, I tried the clip rotation and then rotating a container clip to
the inverse rotation method. This created some pretty ugly jaggies
which were unacceptable.
Second, I did some Flash trickery and created an invisible
14 matches
Mail list logo