heres a js library has an oval function... might be of some use to get you going

http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm

Thanks very much Ryan - looks like a good start - I can use maybe a
little of that, but an ellipse is also mathematically quite different,
and I'm not sure how I would go about modifying your example to fit an
ellipse shape.
Plus, it seems (though I haven't tested it) you are hard coding values
in there, assuming there are 20 clips and thus have hard coded values
such as 41 80, so that determines the spacing - I need a function that
will dynamically spread them out evenly, not knowing how many there will
be.  But seriously, thanks very much, for sending what you did.  I'm
just not mathematically adept enough to translate that to my problem.
Other ideas?

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com





-----Original Message-----
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Ryan Matsikas
Sent: Thursday, March 16, 2006 7:01 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Position objects evenly around ellipse

I have some code I used in a project todo a similiar idea.. this
should get
you started.. puts the clips around a perfect circle.. you'll have to
play
with it a bit.

var clipPosition:Number = 0;
function setPosition(p_clip:MovieClip):Void {
  clipPosition += 60;
  var r:Number = clipPosition*Math.PI/180;
  var d:Number = 80;
  if (r/Math.PI*180>760) {
      r += 180;
      d += 155;
      clipPosition -= 41;
  } else if (r/Math.PI*180>360) {
      d += 80;
      clipPosition -= 30;
  }
  p_clip._x = Math.cos(R)*d;
  p_clip._y = Math.sin(R)*d;
}
for (var i = 0; i<20; i++) {
  var clip = this.attachMovie("clip", "clip_"+i, i);
  setPosition(clip);
}

Cheers,
Ryan

On 3/16/06, Merrill, Jason <[EMAIL PROTECTED]> wrote:
Would anyone have a function, class, formula, idea whatever that
would
allow me to calculate X and Y values to place an "n" number of movie
clips evenly spaced around an ellipse/oval shape?  The number of
clips
can vary based on external data.  The ellipse would also have to be
calculated I suppose, but not actually drawn - the representation of
it
would be a separate graphic.

I found the algebraic formula for an ellipse on a Cartesian plane to
be:
Ax2 + Bxy + Cy2 + Dx + Ey + F = 0

But no idea how to make a translation to my problem.

Thanks!

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com



NOTICE:
This message is for the designated recipient only and may contain
privileged or confidential information. If you have received it in
error,
please notify the sender immediately and delete the original. Any
other use
of this e-mail by you is prohibited.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to