Flash :: Draw Two Intersecting Circle Holes In Graphics?

Oct 25, 2011

I need draw rectangle with two circle holes inside. The problem is in circles interception. I want them to join together and cut from background, but they seems to be XORed:

At first I tried drawRect and DrawCircle:

graphics.beginFill(0, 0.5);
graphics.drawRect(0, 0, width, height);
graphics.drawCircle(width/2, height/2, 50);

[Code].....

here getCirclePath returns object with points to draw polygon which looks like circle. Also I tried different combinations of GraphicsPathWinding constants, but no luck.

how to draw two intersecting circle holes in graphics?

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Graphics - Paint (change Color) Inside Of Circle When A User Draw A Circle

Aug 24, 2009

I`m working on a app that you can draw lines.....like circles, rectangles... my problem is when a user draw a circle for example....i wanna be able to paint (change color) inside of this circle. I`ve tried working on Shapes with cacheAsBitmap = true and Bitmaps with BitmapData but it doesn`t seens to work.

View 4 Replies

Flex :: Draw A Circle Inside Border Container Using Graphics Object?

Apr 5, 2011

My basic requirement is to draw a circle inside a BorderContainer with the layout set to BasicLayout.I run this method in the CREATION_COMPLETE event of the BorderContainer object.[code]I know I must be missing something VERY basic here. Can I just draw like this OR should I draw in some other event? I know that I can create a Ellipse object and easily add it to the border container but I would like to know how I can do this using the graphics object.

View 3 Replies

ActionScript 3.0 :: Draw One BeginFill/endFill Session But Without "holes" In The Final Shape?

May 6, 2010

I have two questions about drawing shapes in action script 3.0, using graphics class (flash.display.Graphics):Question 1.When I draw some more complicated shape consisted of a few simpler shapes (i.e. two circles), and the shapes overlaps, the overlapped region is inverted (is rendered as a "hole"). Is there any way to avoid that?This is simple example of this behaviour:

var oClip : MovieClip = new MovieClip();oClip.graphics.beginFill( 0x000000, 0.5 );oClip.graphics.drawCircle( 150, 200, 70 );oClip.graphics.drawCircle( 250, 200, 100 );oClip.graphics.endFill();this.addChild( oClip );

I know,I can do it using separate beginFill/endFill sections for each circle:

var oClip : MovieClip = new MovieClip();oClip.graphics.beginFill( 0x000000, 0.5 );oClip.graphics.drawCircle( 150, 200, 70 [code]....

but then when I use alpha blending, the shapes are blended separatelly. Unfortunatelly, this is not correct for that what I want to do.I need to draw one beginFill/endFill session but without "holes" in the final shape, is it possible?Question 2.Is there an action script counterpart of the Flash menu option: Modify->Break Apart ?

View 4 Replies

Flash :: Draw Circle On Custom Flv Player?

Sep 8, 2010

i have the custom flv player which reads an XmL and draws circles on Flv video. Postion and time is specified in the XML. I did calculation with as3 getTimer() function. It works fine, no matter how long u pause and then play again. Circles are shown at right time.Now i have two problems

1- How getTimer can be reset?? it is required when user is allowed to play another swf..

2- Is there any other way besides getTimer calculation. I am not using Timer Class as it is Dependant on Frame-Script Execution time and may yield wrong result so this is not as accurate as getTimer() function.

3- As i am using Custom Slider , so i have to do calculations each time when user click or drag slider w.r.t getTimer() function and then subtracts seconds and all that. but again it goes very hard when user plays another swf as my calculations are based on getTimer() Funtion.

View 1 Replies

Flash - Draw A Bitmap In Graphics-Object At Any Position?

Mar 30, 2011

Is it possible to draw a Bitmap to a Graphics-Object like

this.graphics.beginBitmapFill(bitmapData, matrix, false);
this.graphics.drawRect(0, 0, w, h);
this.graphics.endFill();

with an offset?

A simple moveTo(x, y) call before beginBitmapFill does not work :/ Neither does changing the x and y value of drawRect... (That just seems to have the same effect as an translation with the matrix...) Additionally I don't want do draw that thing in a separate Graphics-Object and add that one into the other...

View 2 Replies

Draw Animated Circle With Brush Tool In Flash?

Aug 19, 2009

I need to make a circle with a brush tool so that it looks like a child draws it. If I make a dot with the brush tool on the first frame and a circle on the 15th frame and then create shape tween between those frames it looks stupid, like the circle grows itself. Is there any possibility of making such a thing except for drawing it per frame?

View 3 Replies

ActionScript 3.0 :: Draw A Oval Circle In Authoring Flash

Feb 15, 2011

I draw a circle in authoring flash or in as3 and when i test it in flash ;it looks ok but when i doubleclik the swf in flashplayer i get an oval instaed of a circle!!!

View 1 Replies

Flash - Why Doesn't This Circle Draw All The Points Correctly

Dec 28, 2011

I'm having issues with drawing a circle. The code seems to work for drawing all the required segments except one, but tracing the points of the drawing looks correct.This is the class that generates the segments:

package views
{
import flash.display.Sprite;
import flash.geom.Point;

[code]....

View 1 Replies

Flash :: Draw A Line From A Point To Opposite Tangents On A Circle? Cone/wedge Shape?

Apr 15, 2011

This should be a bit of simple geometry: How do I calculate the points to draw the lines in the code below so that it makes a 2D cone or wedge shape?

import flash.geom.Point;

//draw circle
var mc=new Sprite()[code]...........

UPDATE:I should have mentioned my aim is not to draw a wedge shape, but to draw a line from a random point to the edge of an existing circle.If you're more comfortable with algebra than actionscript,

View 5 Replies

Actionscript 3 :: Graphics - LineStyle Thickness To Fill A Circle?

May 19, 2010

i'm trying to build a circle using lines. each line starts in the centre of the circle and is as long as the circle's radius. using a loop along with sine and cosign waves, i can build the circle using the sine and cosign to mark the coordinates of the lineTo parameter.

my problem is with the line thickness parameter of lineStyle. i would like the ends of the lines to match up perfectly, no matter how big the circumference of the circle, but i can't figure out a proper method for the line thickness.

//this is what makes sense to me, but it still creates some gaps
lineThickness = 1 + (((nRadius * 2) * Math.PI) - 360) / 359;
for(var i:int = 0; i < 360; i++)

[code]....

to make the ends of the lines meet up at the circles circumference, without any gaps, i need to widen the lines to fill in the space that's remaining. what makes sense to me, but doesn't work, is to subtract the 360 from the circumference, then divide that number by the amount of empty slots between the lines (which is 359) and adding that number the the thickness of 1.

what's concerning me is that the lineStyle thickness parameter is a Number, but seems to take only values between 0 and 255, so i'm not sure if a floating point number like 1.354 is a valid thickness.

View 1 Replies

Actionscript 3 :: Draw A Circle Using It?

Jul 27, 2010

How to draw a circle using action script (as a component) i tried some xample did not work.

View 2 Replies

ActionScript 2.0 :: Draw A Circle With It?

Jan 7, 2010

I am making a simple drawing application, and i have come across a problem. Im not very good with trig at all so i got the code for drawing a circle and customised it and it goes a little dodgy. Could someone tell me why it is happening, and how i should fix it?

View 3 Replies

ActionScript 3.0 :: Draw Three Quarter Circle?

Jun 12, 2009

I need to draw a circle like a pie chart. But I need the circle to only go around about 2/3's or whatever I choose. I've tried the 'curveTo' method but that didn't work. It makes the circle more bulged and not round like a circle.how to make a perfect circle with a slice taken out?

View 2 Replies

ActionScript 3.0 :: Any Way To Draw Shapes (Circle)?

Mar 16, 2010

Any way of drawing circles with AS? I'd like to draw a number of small MC's on the stage in a circle actually. My problem is how to draw in a circle.

View 5 Replies

Actionscript 3 :: How To Draw A Semi Circle

Jul 27, 2010

using action script how to draw a semi circle...i need to add tha semicircle in another circle the circle looks like this ![alt text][1] how to draw a semi circle inside that circle

View 1 Replies

Actionscript 3 :: Draw Circle With Hole In It Using Only It?

Sep 2, 2010

I want to draw a circle in as3 that has a 'hole' in it (like a donut). Something like this, but without the outlines[code]...

View 4 Replies

Actionscript :: Draw Circle In A New Layer?

Mar 31, 2011

i do not want to draw a circle on the same layer the background is. So how can i separate background layer and drawing layer? using graphics.drawCircle to draw circle

View 1 Replies

ActionScript 3.0 :: Memory, Graphics.draw And Clear?

Jan 11, 2010

i have a movieClip. On it i draw a few rundedRects, when i resize the window i use graphics.clear to remove it, and then reDraw the Rects. Will this result in memory leakages? or will flash reuse the memory address as long as i draw on the same sprite?

View 1 Replies

Flex :: Draw A Circular Arc In MXML Graphics?

Feb 20, 2011

Is there a simple way to draw a circular arc in MXML graphics that doesn't involve beziers? Or should I create my own component?

View 4 Replies

ActionScript 3.0 :: Dynamically Draw A Cemi Circle

Aug 24, 2009

I have a requirement wherien a semi circle has to be drawn. The circle radius can be chosen/varied by the user. How can i do it dynamicaly using action script.

View 1 Replies

ActionScript 3.0 :: Draw A Line That Is A Radius Of A Circle?

Apr 23, 2010

I want to draw a circle on the scrren of a random x,y position and a random radius. Then, I would like to draw a line that starts at the center of the circle and ends at the spot where the circle ends, at its perimeter. All I have been capable of doing by myself was creating that circle and set the drawing position with the moveTo function to its center, but I don't know how to calculate the length of the radius, so I have the coordinates for the lineTo function.

View 7 Replies

ActionScript 3.0 :: Draw A Circle With A Hole Inside?

Oct 11, 2010

i drew a circle and i want to make a hole inside it ,, here is my code -->

ActionScript Code:
var _Target:Sprite=new Sprite();
_Target.graphics.beginFill(0xFFCC00);

[code].......

View 3 Replies

Actionscript 3.0 :: Draw A Complete Circle In 7 Seconds?

Apr 24, 2009

This code is to be the animation that shows how much time is left before a specific event fires off. I am struggling with the Math though. How can I calculate how often to have a Timer function fire to draw a complete circle in 7 seconds? (It is 7 for now but may change so it would be nice to have the value be calculated).This code is all in the document class: [URL]

Code: Select allpackage {
import flash.display.*;
import flash.events.*;

[code].....

View 5 Replies

Actionscript 3 :: Draw Shapes On BitmapData / Getting Its Graphics Context

Aug 9, 2010

What would be your recommendation for drawing shapes (rects, circles...) onto BitmapData, and how to effectively switch between colors.Draw shapes on BitmapData / getting its graphics context

Is there any way to get graphics context from BitmapData so I could easily paint shapes using graphics.draw...()?

View 1 Replies

Actionscript 3 :: Draw Shadow Without Filter On Graphics Object?

Sep 27, 2010

I have a complex graphics data on a sprite or a shape (no matter which is exactly). But I want to draw shadow (inner too) for one Rect ( [10, 10, 240, 25] for example) or another path.

[Code]...

View 1 Replies

ActionScript 3.0 :: Draw A Perfect Circle On EnterFrame Event?

Nov 3, 2010

This draws almost perfect circle:

ActionScript Code:
var _angle:Number = 0;
var _speed:Number = .1;
var _radius:Number = 100;

[code]...

but...... if I wanted the circle to be drawn faster and change _speed to lets say .7 the circle becomes a polygon. How to get the circle to be drawn fast so it looks like a circle?

View 9 Replies

ActionScript 2.0 :: Draw A Square/circle/anything One Pixel At A Time?

Jul 27, 2005

how to draw a square/circle/anything one pixel at a time, using Actionscript instead of tweens?

View 1 Replies

ActionScript 2.0 :: Draw A Line / Circle And Place A Movie Clip On It?

Aug 6, 2009

I was wondering if anyone could tell me how and if it is possible to draw a line/ circle and place a movie clip on it and get the movie clip to go round the circle by placing the left and right arrow keys on the keyboard.

View 0 Replies

ActionScript 3.0 :: Draw A Simple Circle Behind My Class Both Center Aligned?

Oct 20, 2009

I want to draw a simple circle behind my class both center aligned, but I'm getting problems with the coordenates of my class/movieclip.Here is my class.

public class SM extends MovieClip {
public var auxx:Number;
public var auxy:Number;[code].....

I think that my class/movieclip isn't at (100,50) because when I manually substitute 'auxx' and 'auxy' in drawCircle for 100 and 50, still not ok.

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved