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
Similar Posts:
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
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
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
Jan 13, 2012
I am creating an flex Air project,so mxml file will run. I have circles in one Big circle at one side and will be same on other side.
Now how to drag any circle from any Big circle to other side. Or it could be like any two container having circles, then how to drag and drop circle?
For one circle i am able to do drag and drop.But I want one Big circle on left hand side and one big circle on right hand side .And small circles with class names will be in these big circles.Now i want to drag and drop those small circles in big circles.Big cicles should not move. Even i have tried this code in actionscript
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
[Code].....
But in this i want big circles should not move and small circles should only be dragged.
View 1 Replies
May 25, 2011
how to draw border for even/uneven shape object? it is stored in a movieclip
View 0 Replies
Jan 1, 2011
class A:
[SWF(width='800',height='600',frameRate='24')]
public class A extends MovieClip {
private var b:B;[code]....
this.graphics calls do nothing in draw method, but work fine inside B`s constructor, what i am doing wrong ?
View 2 Replies
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
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
Oct 29, 2009
How can i draw sound spectrum inside a display container other than stage?I tried to display it inside the rectangle movieclip but end up in failure.[code]...
View 2 Replies
Oct 31, 2011
I'm using flex and drawing a circle using the Spark Ellipse primitive. I am setting the x,y coordinates of the circle myself. I am drawing them within a TitleWindow component. Is it possible to force the circle to not be allowed if I specify a coordinate that is outside the TitleWindow? Or do I have to check the coordinates manually myself?
View 1 Replies
Jul 22, 2011
Using Flex 4 AIR, what is the maximum widtha and height I can set for line and the bordercontainer?
bc:borderContainer = new borderContainer();
bc.width = 80000;
bc.height = 80000;
View 1 Replies
Mar 16, 2011
Let's assume I have an Image that's used a button. By default, the image has no border around it. Clicking on this Image will cause another component be displayed beneath it or next to it. When the second component is displayed, I want to draw a joined border around the Image and the second component.
The second component would not be visible by default. It would only be visible after clicking on the Image by using the popupManager, PopUpAnchor, setting the visible property, etc.
Example before clicking:
+--------------------------------+
| |
| XXX <-- My Image |
| XXX |
| |
| |
| |
| |
| |
| |
| |
+--------------------------------+
Example after clicking:
+--------------------------------+
| +---+ |
| |XXX| <-- My Image |
| |XXX|_______________ |
| | | |
| | My Second | |
| | Component | |
| | | |
| | | |
| +-------------------+ |
| |
+--------------------------------+
How difficult would it be to create something like this?
View 2 Replies
May 12, 2011
I have a project where I display content from an array. I also need to display ratings- which is between 1- 5 stars, works fine with correct alternate shading for each line- however, when I mouse-over, the skinnable countainer in the itemrenderer(named cont) still retains the original color it had for that row. As we are using fxg graphics, we have a a skinnable container box containing the ratings with one shade, that lies just within the larger table - with row color having changed on mouse-over. Screenshot attached- you can see the thin patch of blue between the ratings box(dark grey) and the highlighed row on mouseover...
I was told to shift from Datagrid to List to resolve this and for better performance- seems like a biggish task which I messed up.As an easier alternative, was looking to I would like to either
a) get the skinnable container color to disappear, so I see single color in a row on mouseover
b) disable the color change on mouseover for the grid rows, so this issue is avoided .The datagrid is very straighforward as below
<mx:DataGrid id="experimentgrid" fontSize="{12}" fontWeight="bold" color="#006837" styleName="dataGridStyle" rowHeight="{15}" borderVisible="false" showHeaders="false" x="[code]...
View 2 Replies
May 24, 2011
I have a BorderContainer with some instances of spark Line. I need to select this lines by clicking on this. But adding event mouse click listener fails. ASdoc [URL] says that line have only activate and deactivate events. Any best way to detect whether line clicked (use another line class?). I think that catching of clicks in the bordercontainer is bad solution.
View 2 Replies
Mar 21, 2011
Draw rectangle with dashed border in flex ?
View 3 Replies
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
Dec 6, 2010
Is there a way to easily specify on which sides a border is drawn for Flex 4's Spark BorderContainer?[URL]But that uses MX styling which seems like a hack. Is there a better or 'correct' way without having to build a skin? It seems incredibly silly to build a skin for a 'Bordered' component when this is a very common use case.
View 1 Replies
Jan 3, 2011
I have been doing much research on this - including creating a custom skin but cannot seem to be able to do it. I just want to have one border around both the checkbox and label. I also want a background color which I did manage to via opaqueBackground property (setting it via AS3). Just can't seem to find the key to have a border as well.
View 1 Replies
Apr 24, 2010
I have a circle drawn on the screen, wherein I add a moving object. I want it to keep inside. My strategy is to calculate the circle's radius and compare it with the distance the moving object is off its center. I beleive it's the proper solution. However, I'm having a problem with letting Flash know when the running guy should stop, so he doesn't leave the circle and ruin all the fun. Here's the code I'm using (it's not working of course):
function moveTheCreaturesRightwards(event:Event)
{
if(maleMovingRight == true)
{
[Code]....
The line: rayMale.width = maleRadius.width; was added when nothing else had seemed to be working
View 3 Replies
Jan 27, 2010
I'm currently working on a custom component which extends Canvas (let's call it SuperCanvas) ; it's basically a container that let you zoom & pan its contents. It would be too long to explain why, but I can't use scrollRect, so I was forced to declare a Canvas object (called innerCanvas)... inside my SuperCanvas (I know, not very nice =/) I would like to know if there's a proper way to "redirect" the creation of my component's children in this canvas.
[Code]...
View 1 Replies
Jan 7, 2010
Here's the layout:I have a main SWF. Inside that main SWF is a container MC that has been rotated in 3D space to have a bit of perspective. Inside _that_ container is a container MC into which is loaded various images, videos, and SWFs. Images: no problem. Videos: no problem.The problem:If an SWF is loaded into the media MC that has an MC in it with a listener/startDrag combination allowing that MC to be dragged it seems to fail (the drag).I've tested this child SWF extensively to make sure the drag works, and I've even loaded it externally into other SWFs and it works. I've also tested in various ways to make sure that the problem isn't something simple, like an intervening clip in my main SWF keeping the MouseEvent from reaching the MC with the startDrag
View 1 Replies
Sep 30, 2005
i want to make one circle follow the mouse cursor, inside another circle. Similar to an eye looking at the cursor. Ive attached an example.
View 4 Replies
Apr 12, 2012
I am developing a paint board application using flash builder. User can draw some shapes objects(ellipse, circle, rectangle). I want to implement grouping/un grouping feature some like ms-word in my application. I group multiple objects by putting them inside a container(UIComponent). Now i apply resizing to container and it resize well. I am using a free object handler API to apply selection handle over the container. I want to resize and reposition all children with respect to container changed size. Every thing goes well until all children inside container are having rotation = 0. But if there is any child which is having rotation >0 and <0 things goes worse. The child resize but not in a proper manner. I stretch the parent container width and it increase the height of rotated child. Is there any way using Matrix class or something else to transform all children in same direction and same ratio respective to container?
View 1 Replies
Oct 19, 2011
Is there anyway I can effectively call the equiv. of setText on a Flex Graphics object ?Specifically I'm using a custom cell renderer to display data in a datagrid. The renderer uses the Graphics object to set the background colour of only a portion of the cell (say the left half) based upon the underlying data. I would like to be able to have text over only that portion of the cell which has the background colour (eg centred within the left half). I know all the widths (of both the cell itself and the graphics object) but I don't know how I can set text (centred) over the graphics object.
View 5 Replies
Nov 3, 2009
Is there anyway I can effectively call the equiv. of setText on a Flex Graphics object ?
Specifically I'm using a custom cell renderer to display data in a datagrid. The renderer uses the Graphics object to set the background colour of only a portion of the cell (say the left half) based upon the underlying data. I would like to be able to have text over only that portion of the cell which has the background colour (eg centred within the left half).
I know all the widths (of both the cell itself and the graphics object) but I don't know how I can set text (centred) over the graphics object.
View 4 Replies
Apr 20, 2007
I have a template which loads thums form XML file, i want to modify the thumbs to have a border around each one and alfa rollover effect.
Code:
function createThubmnail(thumbURL) {
thumbsHolder.attachMovie("itemPhoto", "itemPhoto"+photoN, photoN);
eval("thumbsHolder.itemPhoto"+photoN).picture.picture.loadMovie(thumbURL);
eval("thumbsHolder.itemPhoto"+photoN).d_w = widthThumb;
[code]....
View 2 Replies
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
Feb 1, 2004
Here's my latest attempt at rendering a dynamic rectange (w/ width, height, border_width, border_color & background_color) I'm trying to render a dashed border, and can't seem to get the code right...
I've reworked my logic about five times, and can get the dashes to render right (almost) but the fill color disappears. It's rendered using actionscript. You can see the issues if you change the border width.[code]...
View 3 Replies
Nov 5, 2007
how to draw a border around image or movie clip?
View 11 Replies