Re: [Flashcoders] newbie question - drawing a ring

2006-11-13 Thread David Cake
	Thanks to everyone who helped out a few weeks ago when I 
asked about drawing a ring or doughnut shape.

Here is AS3 code to do this, based on the AS1 code in this post
http://chattyfig.figleaf.com/pipermail/flashcoders/2005-October/152572.html

private function drawRing (r1:Number, r2:Number, x:Number, y:Number):void {
   var TO_RADIANS:Number = Math.PI/180;

   circle.graphics.moveTo(r1+x,0+y);
   var endx:Number;
   var endy:Number;
   var ax:Number;
   var ay:Number;

   // draw the 30-degree segments
   var a:Number = 0.268;  // tan(15)
   for (var i:uint=0; i  12; i++) {
  endx = r1*Math.cos((i+1)*30*TO_RADIANS);
  endy = r1*Math.sin((i+1)*30*TO_RADIANS);
  ax = endx+r1*a*Math.cos(((i+1)*30-90)*TO_RADIANS);
  ay = endy+r1*a*Math.sin(((i+1)*30-90)*TO_RADIANS);
  circle.graphics.curveTo(ax+x, ay+y, endx+x, endy+y);
   }

   // cut out middle (go in reverse)
   circle.graphics.moveTo(r2+x, 0 +y);

   for (i=12; i  0; i--) {
  endx = r2*Math.cos((i-1)*30*TO_RADIANS);
  endy = r2*Math.sin((i-1)*30*TO_RADIANS);
  ax = endx+r2*(0-a)*Math.cos(((i-1)*30-90)*TO_RADIANS);
  ay = endy+r2*(0-a)*Math.sin(((i-1)*30-90)*TO_RADIANS);
  circle.graphics.curveTo(ax+x, ay+y, endx+x, endy+y);
   }
}


Regards
David
___
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


Re: [Flashcoders] newbie question - drawing a ring

2006-10-20 Thread Janis Radins

check out www.mediaverk.lv/asd it might give you just what you need


2006/10/20, Guntur N. Sarwohadi [EMAIL PROTECTED]:


Hello David,

You can use flash drawing API. You might use just 2 drawing methods:

moveTo(x,y) moves a pointer from where you want to start drawing from

and

curveTo(cpx, cpy, x, y) draws a curve with cpx is the location of the
curve
control point by x, cpx is the curve control point by y, and x  y is the
final point / destination to draw

you might as well define the line style using lineStyle or filling it with
a
color using beginFill and then endFill.

it's all in the help / manual located at the IDE..

Hope this helps,

Guntur N. Sarwohadi

On 10/20/06, David Cake [EMAIL PROTECTED] wrote:

 New to the list, new to Flash/flex, experienced java/C/web
 etc coder. Please excuse me if my question is in a FAQ that I should
 have read somewhere (and feel free to direct me to such resources)

 I want to create a vector ring shape, a circle with an
 excised inner circle, in code. I don't want to use tricks like
 gradient fills that make it look like a ring - I want sharp borders
 (and there are a lot of additional graphic elements that I want to
 look like part of the same object within the ring). I haven't been
 able to find any examples that create vectors with internal holes to
 them.
 Regards
 David
 ___
 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


Re: [Flashcoders] newbie question - drawing a ring

2006-10-20 Thread Victor Gaudioso

okay, try this:  make say this:

this.email.sendAndLoad(http://www.yourwebsite.com/sendMail.php;, 
this.emailResponse, POST);



and then run it locally of your hard drive.  If it works then put it on the 
server and try it.  Let me know what happens.  V


- Original Message - 
From: Janis Radins [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, October 20, 2006 7:56 AM
Subject: Re: [Flashcoders] newbie question - drawing a ring



check out www.mediaverk.lv/asd it might give you just what you need


2006/10/20, Guntur N. Sarwohadi [EMAIL PROTECTED]:


Hello David,

You can use flash drawing API. You might use just 2 drawing methods:

moveTo(x,y) moves a pointer from where you want to start drawing from

and

curveTo(cpx, cpy, x, y) draws a curve with cpx is the location of the
curve
control point by x, cpx is the curve control point by y, and x  y is the
final point / destination to draw

you might as well define the line style using lineStyle or filling it 
with

a
color using beginFill and then endFill.

it's all in the help / manual located at the IDE..

Hope this helps,

Guntur N. Sarwohadi

On 10/20/06, David Cake [EMAIL PROTECTED] wrote:

 New to the list, new to Flash/flex, experienced java/C/web
 etc coder. Please excuse me if my question is in a FAQ that I should
 have read somewhere (and feel free to direct me to such resources)

 I want to create a vector ring shape, a circle with an
 excised inner circle, in code. I don't want to use tricks like
 gradient fills that make it look like a ring - I want sharp borders
 (and there are a lot of additional graphic elements that I want to
 look like part of the same object within the ring). I haven't been
 able to find any examples that create vectors with internal holes to
 them.
 Regards
 David
 ___
 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


Re: [Flashcoders] newbie question - drawing a ring

2006-10-20 Thread Victor Gaudioso
Sorry, my last reply was in response to someone else's question.  Early 
morning mistake, I apologize.  Hope it didn't confuse anyone too bad.  V
- Original Message - 
From: Victor Gaudioso [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, October 20, 2006 8:14 AM
Subject: Re: [Flashcoders] newbie question - drawing a ring



okay, try this:  make say this:

this.email.sendAndLoad(http://www.yourwebsite.com/sendMail.php;, 
this.emailResponse, POST);



and then run it locally of your hard drive.  If it works then put it on 
the server and try it.  Let me know what happens.  V


- Original Message - 
From: Janis Radins [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, October 20, 2006 7:56 AM
Subject: Re: [Flashcoders] newbie question - drawing a ring



check out www.mediaverk.lv/asd it might give you just what you need


2006/10/20, Guntur N. Sarwohadi [EMAIL PROTECTED]:


Hello David,

You can use flash drawing API. You might use just 2 drawing methods:

moveTo(x,y) moves a pointer from where you want to start drawing from

and

curveTo(cpx, cpy, x, y) draws a curve with cpx is the location of the
curve
control point by x, cpx is the curve control point by y, and x  y is 
the

final point / destination to draw

you might as well define the line style using lineStyle or filling it 
with

a
color using beginFill and then endFill.

it's all in the help / manual located at the IDE..

Hope this helps,

Guntur N. Sarwohadi

On 10/20/06, David Cake [EMAIL PROTECTED] wrote:

 New to the list, new to Flash/flex, experienced java/C/web
 etc coder. Please excuse me if my question is in a FAQ that I should
 have read somewhere (and feel free to direct me to such resources)

 I want to create a vector ring shape, a circle with an
 excised inner circle, in code. I don't want to use tricks like
 gradient fills that make it look like a ring - I want sharp borders
 (and there are a lot of additional graphic elements that I want to
 look like part of the same object within the ring). I haven't been
 able to find any examples that create vectors with internal holes to
 them.
 Regards
 David
 ___
 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



___
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


RE: [Flashcoders] newbie question - drawing a ring

2006-10-20 Thread Alain Rousseau
This has been talked about in the Archives I believe ... You could search it
, but I remember that to be able to create a ring using the drawing API, you
first need to draw the outer circle clockwise and then draw your innercircle
counter-clockwise all that inside  beginFill and endFill.

That's what I remember, but I might be wrong somewhere ... Look it up in the
Archives (this or last year), it was a post by Helen Triolo if I remember
right.

HTH

Alain

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Janis Radins
Sent: 20 octobre 2006 10:56
To: Flashcoders mailing list
Subject: Re: [Flashcoders] newbie question - drawing a ring

check out www.mediaverk.lv/asd it might give you just what you need


2006/10/20, Guntur N. Sarwohadi [EMAIL PROTECTED]:

 Hello David,

 You can use flash drawing API. You might use just 2 drawing methods:

 moveTo(x,y) moves a pointer from where you want to start drawing from

 and

 curveTo(cpx, cpy, x, y) draws a curve with cpx is the location of the 
 curve control point by x, cpx is the curve control point by y, and x  
 y is the final point / destination to draw

 you might as well define the line style using lineStyle or filling it 
 with a color using beginFill and then endFill.

 it's all in the help / manual located at the IDE..

 Hope this helps,

 Guntur N. Sarwohadi

 On 10/20/06, David Cake [EMAIL PROTECTED] wrote:
 
  New to the list, new to Flash/flex, experienced java/C/web 
  etc coder. Please excuse me if my question is in a FAQ that I should 
  have read somewhere (and feel free to direct me to such resources)
 
  I want to create a vector ring shape, a circle with an 
  excised inner circle, in code. I don't want to use tricks like 
  gradient fills that make it look like a ring - I want sharp borders 
  (and there are a lot of additional graphic elements that I want to 
  look like part of the same object within the ring). I haven't been 
  able to find any examples that create vectors with internal holes to 
  them.
  Regards
  David
  ___
  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


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.8/489 - Release Date: 2006-10-20
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.8/489 - Release Date: 2006-10-20
 

___
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


RE: [Flashcoders] newbie question - drawing a ring

2006-10-20 Thread Alain Rousseau
Speaking of wich, just found it in my inbox ... Here is a link :

http://flash-creations.com/notes/dynamic_drawingapi.php#cutoutmask 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alain
Rousseau
Sent: 20 octobre 2006 11:49
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] newbie question - drawing a ring

This has been talked about in the Archives I believe ... You could search it
, but I remember that to be able to create a ring using the drawing API, you
first need to draw the outer circle clockwise and then draw your innercircle
counter-clockwise all that inside  beginFill and endFill.

That's what I remember, but I might be wrong somewhere ... Look it up in the
Archives (this or last year), it was a post by Helen Triolo if I remember
right.

HTH

Alain

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Janis Radins
Sent: 20 octobre 2006 10:56
To: Flashcoders mailing list
Subject: Re: [Flashcoders] newbie question - drawing a ring

check out www.mediaverk.lv/asd it might give you just what you need


2006/10/20, Guntur N. Sarwohadi [EMAIL PROTECTED]:

 Hello David,

 You can use flash drawing API. You might use just 2 drawing methods:

 moveTo(x,y) moves a pointer from where you want to start drawing from

 and

 curveTo(cpx, cpy, x, y) draws a curve with cpx is the location of the 
 curve control point by x, cpx is the curve control point by y, and x  
 y is the final point / destination to draw

 you might as well define the line style using lineStyle or filling it 
 with a color using beginFill and then endFill.

 it's all in the help / manual located at the IDE..

 Hope this helps,

 Guntur N. Sarwohadi

 On 10/20/06, David Cake [EMAIL PROTECTED] wrote:
 
  New to the list, new to Flash/flex, experienced java/C/web 
  etc coder. Please excuse me if my question is in a FAQ that I should 
  have read somewhere (and feel free to direct me to such resources)
 
  I want to create a vector ring shape, a circle with an 
  excised inner circle, in code. I don't want to use tricks like 
  gradient fills that make it look like a ring - I want sharp borders 
  (and there are a lot of additional graphic elements that I want to 
  look like part of the same object within the ring). I haven't been 
  able to find any examples that create vectors with internal holes to 
  them.
  Regards
  David
  ___
  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


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.8/489 - Release Date: 2006-10-20
 

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.8/489 - Release Date: 2006-10-20
 

___
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


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.8/489 - Release Date: 2006-10-20
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.8/489 - Release Date: 2006-10-20
 

___
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] newbie question - drawing a ring

2006-10-19 Thread David Cake
	New to the list, new to Flash/flex, experienced java/C/web 
etc coder. Please excuse me if my question is in a FAQ that I should 
have read somewhere (and feel free to direct me to such resources)


	I want to create a vector ring shape, a circle with an 
excised inner circle, in code. I don't want to use tricks like 
gradient fills that make it look like a ring - I want sharp borders 
(and there are a lot of additional graphic elements that I want to 
look like part of the same object within the ring). I haven't been 
able to find any examples that create vectors with internal holes to 
them.

Regards
David
___
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


Re: [Flashcoders] newbie question - drawing a ring

2006-10-19 Thread Muzak
If you mean a donut:
This is old AS1 (ActionScript 1) code, but should be easy to port to AS2.
http://chattyfig.figleaf.com/pipermail/flashcoders/2005-October/152572.html

There might be more in the archives:
http://muzakdeezign.com/flashcoders/?q=donut
http://muzakdeezign.com/flashcoders/?q=draw%20circle
http://muzakdeezign.com/flashcoders/?q=draw%20ring

regards,
Muzak

- Original Message - 
From: David Cake [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Friday, October 20, 2006 6:53 AM
Subject: [Flashcoders] newbie question - drawing a ring


 New to the list, new to Flash/flex, experienced java/C/web etc coder. Please 
 excuse me if my question is in a FAQ that I should 
 have read somewhere (and feel free to direct me to such resources)

 I want to create a vector ring shape, a circle with an excised inner circle, 
 in code. I don't want to use tricks like gradient 
 fills that make it look like a ring - I want sharp borders (and there are a 
 lot of additional graphic elements that I want to look 
 like part of the same object within the ring). I haven't been able to find 
 any examples that create vectors with internal holes to 
 them.
 Regards
 David


___
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


Re: [Flashcoders] newbie question - drawing a ring

2006-10-19 Thread Guntur N. Sarwohadi

Hello David,

You can use flash drawing API. You might use just 2 drawing methods:

moveTo(x,y) moves a pointer from where you want to start drawing from

and

curveTo(cpx, cpy, x, y) draws a curve with cpx is the location of the curve
control point by x, cpx is the curve control point by y, and x  y is the
final point / destination to draw

you might as well define the line style using lineStyle or filling it with a
color using beginFill and then endFill.

it's all in the help / manual located at the IDE..

Hope this helps,

Guntur N. Sarwohadi

On 10/20/06, David Cake [EMAIL PROTECTED] wrote:


New to the list, new to Flash/flex, experienced java/C/web
etc coder. Please excuse me if my question is in a FAQ that I should
have read somewhere (and feel free to direct me to such resources)

I want to create a vector ring shape, a circle with an
excised inner circle, in code. I don't want to use tricks like
gradient fills that make it look like a ring - I want sharp borders
(and there are a lot of additional graphic elements that I want to
look like part of the same object within the ring). I haven't been
able to find any examples that create vectors with internal holes to
them.
Regards
David
___
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