[Flashcoders] Erasing areas with the drawing API?

2007-02-16 Thread David Ham
Does anyone know how to erase part of an area that was created with  
the drawing API? I need to be able to draw a polygon, and then draw  
another polygon inside it and punch it out. For example, I need to  
draw a square and then punch a square hole in it. Anyone ever done  
this before?


OK
DAH
--
David Ham
http://davidham.com ::  [EMAIL PROTECTED]



___
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] Erasing areas with the drawing API?

2007-02-16 Thread Claus Wahlers

David Ham wrote:

Does anyone know how to erase part of an area that was created with the 
drawing API? I need to be able to draw a polygon, and then draw another 
polygon inside it and punch it out. For example, I need to draw a 
square and then punch a square hole in it. Anyone ever done this before?


graphics.lineStyle(1, 0x00);
graphics.beginFill(0xff);
graphics.moveTo(10, 10);
graphics.lineTo(90, 10);
graphics.lineTo(90, 90);
graphics.lineTo(10, 90);
graphics.lineTo(10, 10);
graphics.moveTo(30, 30);
graphics.lineTo(70, 30);
graphics.lineTo(70, 70);
graphics.lineTo(30, 70);
graphics.lineTo(30, 30);
graphics.endFill();

Cheers,
Claus.

--
claus wahlers
cĂ´deazur brasil
http://codeazur.com.br/
http://wahlers.com.br/claus/blog/

--
READ CAREFULLY. By reading this email you agree, on behalf of your 
employer, to release me from all obligations and waivers arising from 
any and all NON-NEGOTIATED agreements, licenses, terms-of-service, 
shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, 
non-compete and acceptable use policies (BOGUS AGREEMENTS) that I have 
entered into with your employer, its partners, licensors, agents and 
assigns, in perpetuity, without prejudice to my ongoing rights and 
privileges. You further represent that you have the authority to release 
me from any BOGUS AGREEMENTS on behalf of your employer.

___
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] Erasing areas with the drawing API?

2007-02-16 Thread Helen Triolo
Yes -- draw the second (inner) shape before you do the endFill and it 
will be punched out.  If you need the final shape to be a mask, draw the 
inner shape in the reverse direction from how you drew the outer shape 
(ie, counter-clockwise if the original shape was drawn clockwise). 

http://flash-creations.com/notes/dynamic_drawingapi.php at the bottom of 
the page


Helen

--
http://flash-creations.com
http://i-technica.com


David Ham wrote:

Does anyone know how to erase part of an area that was created with  
the drawing API? I need to be able to draw a polygon, and then draw  
another polygon inside it and punch it out. For example, I need to  
draw a square and then punch a square hole in it. Anyone ever done  
this before?


OK
DAH







___
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] Erasing areas with the drawing API?

2007-02-16 Thread David Ham
Huh, that was easy. Turns out that if you don't call endFill(), you  
can just draw the polygon, moveTo() the hole, and lineTo() the  
outline of the hole, and it fills itself in.


I found an example of this in this article:

http://www.adobe.com/devnet/flash/articles/adv_draw_methods.html

Specifically in the drawGear() example.

OK
DAH


On Feb 16, 2007, at 4:54 PM, David Ham wrote:

Does anyone know how to erase part of an area that was created with  
the drawing API? I need to be able to draw a polygon, and then draw  
another polygon inside it and punch it out. For example, I need  
to draw a square and then punch a square hole in it. Anyone ever  
done this before?


OK
DAH
--
David Ham
http://davidham.com ::  [EMAIL PROTECTED]



___
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] Erasing areas with the drawing API?

2007-02-16 Thread David Ham


Thanks very much Helen and Claus for your responses!

OK
DAH

Huh, that was easy. Turns out that if you don't call endFill(), you  
can just draw the polygon, moveTo() the hole, and lineTo() the  
outline of the hole, and it fills itself in.


I found an example of this in this article:

http://www.adobe.com/devnet/flash/articles/adv_draw_methods.html

Specifically in the drawGear() example.

OK
DAH


On Feb 16, 2007, at 4:54 PM, David Ham wrote:

Does anyone know how to erase part of an area that was created  
with the drawing API? I need to be able to draw a polygon, and  
then draw another polygon inside it and punch it out. For  
example, I need to draw a square and then punch a square hole in  
it. Anyone ever done this before?


OK
DAH
--
David Ham
http://davidham.com ::  [EMAIL PROTECTED]



___
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