PDA

View Full Version : Dragging a movie clip at a 45 degree angle



waffe
January 19th, 2005, 11:12 AM
We all know how to drag a movie clip:

my_mc.startDrag(target,[lock, left, top, right, bottom])

But does anyone know how to drag/restrict a movie clip to a 45 degree angle?

lostinbeta
January 19th, 2005, 11:16 AM
Contain the drag within a movieclip symbol, then rotate the movieclip symbol that contains the dragger 45 degrees.

waffe
January 20th, 2005, 03:37 AM
Thanks lostinbeta - good idea but I do not know yet if that idea will fully work with what I am trying to do.

I have an idea about how this could be done - is there a way to force a movieclip to to drag on a motion guide? Make a line at an angle, and then assign the movie clip to drag only on the motion guide; can this be done?

waffe
January 20th, 2005, 11:25 AM
The attached fla works well - bit complex, but something to go on. The code was written in flash 4 and there are some syntax errors when I compile in flash 7 AS 2.0

Here are the two types of the compile errors

Errors:
left = getProperty("../point" add /:firstpoint,_x);
..:currentpoint = n;


What did this mean in flash 4 "/:" and "..:". If I knew this, I could possibly convert the code to work in flash 7.

lostinbeta
January 20th, 2005, 11:36 AM
It's the old slash syntax that used to be used in Flash 4 and below.

I don't know what each of them are, but I believe ../ is to go back to _root and /: is to go back one timeline (_parent). I could be wrong though.

I didn't check your .fla file, but have you looked at...
http://www.peterjoel.com/Samples/

Under the 'drag along a path' series.

waffe
January 20th, 2005, 01:18 PM
Thats what I needed Lostinbeta - much better then the fla I posted

Thanks :)