# Moving in a spiral

How would you make an instance move in a spiral?

I tried using the motion guide thing, but there are some problems with that.

1. The spirals aren’t actual spirals… (drawin good ones are hard…)
2. Whenever it gets to a certain point of the guide, it’ll run off the guide and go straight towards the end of the guide.

its possible that your motion path is too confusing and for flash or it may cross at some point or something. Try to redraw your motion path as best as you can and see if that helps. Smooth out the lines too.

you can do a good spiral in freehand or ilustrator and import that in and use it as a guide. I did that in this example:
http://www.umbc.edu/interactive/fla/spintext.swf

There shouldnt be any problem as long as you get the end points right.

Alternatively, you could spiral in code, but Im not sure if you want to take that route or not.

That’s pretty cool senocular,

How would you do a spiral in code? I understand about drawing the guides etc. but don’t have a very steady art hand I’m a lot better at coding than drawing… usually:beam:

Liz

in FH or AI its just a matter of using the spiral tool

basically, in code, its just a matter of spining a clip and expanding the radius of that spin. ex:

``````angle = 0;
origin = {x: myClip._x, y: myClip._y};
myClip.onEnterFrame = function(){
angle += .3;
};
``````

The only problem with this is that your rotation is constant but your distance from the center is increasing which is expanding the arc and the distance traveled, so your clip is actually getting faster as it gets a wider radius. To prevent this, you can reduce its angle increment by a factor of the length of the radius and it will pan out…

``````angle += 5/radius;
``````

cool, thanks senocular.

I’ve seen this type of thing before x:myClip._x does this store the value into the associated variable or just equate that value with a label?

Liz

thats just shorthand object assignment.

origin = {x: myClip._x, y: myClip._y};

is the same as saying

origin = new Object();
origin.x = myClip._x;
origin.y = myClip._y;

{} is shorthand for new Object() just as [] is for new Array(); You can, however, also assign values in {}, but instead of equal signs (=), colons ( are used.

hmm… the hard part is drawing it right then…
with almost perfect circles…

I drew mine with a bunch of circles, one after another, one bigger after another, then connecting them

yeah thats no spiral Do you not have Illustrator or freehand? If not, I could always make you one, alternatively (might be a long shot), you might want to see if any of your fonts have spiral characters. Then you can add one of those, break it apart and add an outline to get an outlined spiral.

oh, I was trying to make a movie clip go in a spiral as it spins
I have photoshop 7, freehand, and uhh, fireworks.

here’s the .fla for a better understanding

Alright, I’ve made a spiral in freehand… now how can I get my instance to recognize the guide?

-=Edit=-
I figured out that I could drag straight from free hand to flash, but is there another way? Perhaps a faster or easier way (though easy enough, good to know other ways)