ActionScript 3.0 :: Modify A DrawCircle Graphics Object?

Sep 21, 2009

I have a Sprite in which I have drawn a circle with a fill.  Later on, I wish to modify the color of this circle.  I have retrieved the Graphics object from the Sprite using getChildAt(), and have tried:
 
getChildAt(i).graphics.beginFill(0x550000);
 
however this does not work.   I've RTFM'd but can't figure out exactly how to deal with the Graphics object.

View 4 Replies


Similar Posts:


Modify Application To Use The Soundchannel Object?

Oct 23, 2009

so I have a lot of classes in actionscript 2. But I need to modify my application to use the soundchannel object for audio monitoring. as far as i know this is only in actionscript 3. so it it possible to write one class in AS3 and leave the rest in AS2?

if not is there a conversion tool which can make the process easier?

View 2 Replies

ActionScript 3.0 :: Modify The Duplicated Object?

Jun 10, 2010

I am trying to duplicate the object and modify them with the following codebut ac8 will not exist until the duplication is complete. Unfortunately the compiler doesn't care that it will be created later, it just keep showing up the same error as always.

if(myglobal.character==1){
for (i=2;i<8;i++){
var ac:b1 = new b1();

[code]...

View 1 Replies

ActionScript 3.0 :: How To Write Words In DrawCircle

Nov 11, 2010

I draw a red color circle,likefollows:graphics.beginFill(color);graphics.drawCircle(0,0,radius);graphics.endFill();Then I want to write a yellow color word in the middle of this circle,for example,I write 'Menu A' in the middle of the circle,what code can I use?

View 1 Replies

AS3 :: Flash - Bind A TextField To A DrawCircle?

Jul 7, 2010

I am drawing a circle on the stage using graphics.drawCircle that rotates around another circle, and I want to have a textfield that sits inside the moving circle and rotates around with it.

View 2 Replies

ActionScript 3.0 :: DrawCircle When No Mouse Interaction

Feb 1, 2011

im using the code below to draw a circle.

How can i modify it so that it draws a circle when the mouse is still. In other words, it draws when teres no mouse interaction, clicks, movments.

ActionScript Code:
_drawboard.addEventListener(MouseEvent.RIGHT_CLICK, _handleMouseEvent);
_drawboard.addEventListener(MouseEvent.MOUSE_UP, _handleMouseEvent);

[Code].....

View 8 Replies

ActionScript 3.0 :: Modify Object X Position Slowly - Shrinking Effect

Jun 8, 2011

I want to modify an object's x position slowly (e.g. 4 pixels per frame) from actionscript. How do I go about doing this? It would be simple if AS3 had Sleep() and DoEvents() functions - are there equivalents?

View 4 Replies

ActionScript 3.0 :: Large Data Sets And Flash DrawCircle API?

Aug 31, 2009

I am writing in reference to Visualizing LARGE Data Sets .

Apparently, using the underlying Flash API for drawing:
g.beginFill( o.x * 0xFFFFFF, 1 )
g.drawCircle( o.x * w, h-(o.y * h), 2 );

[code]......

View 1 Replies

Flex :: Set Text On A Graphics Object?

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

Flex :: Set Text On Graphics Object?

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

ActionScript 3.0 :: Know What Has Been Drawn In A 'graphics' Object

Jul 17, 2009

Lets say I have a customMovieClip. I sometimes draw an ellipse with customMovieClip.graphics and sometimes a rectangle. Now I want to know what was the shape ( ellipse/rect) that was created using a particular graphics object. Doing this would enable me to pinpoint what exactly to do with that customMovieClip() instance.

View 3 Replies

ActionScript 3.0 :: Get The Pixel Color Of A Graphics Object?

Jul 19, 2009

for example,graphics is an object from a movieclip ojbect.I want to get the pixel color at the x,y location in the movieclip.How to do?

View 5 Replies

Actionscript :: Clear Just A Portion Of A Graphics Object?

May 10, 2011

I am making a Flash CS5 application in which the user draws transparent overlays on a Sprite placed on top of an image. The user needs to be able to erase his input as in MS Paint, Adobe Photoshop, or GIMP. Because the Sprite is on top of an image, there is no safe clear color I can think of to draw over the section that the user has just rubbed his eraser over

View 1 Replies

ActionScript 3.0 :: Clear A Certain Area In Graphics Object

Jul 3, 2009

I'm implementing a simple painting programm. Therefor I need something like a Graphics.clear() function, not for the whole Grahpics object, but for a small area only.I don't want to paint in white color instead, I just want to really clear the previously drawn lines and stuff.

View 2 Replies

ActionScript 3.0 :: Calling Graphics In Custom Object?

Dec 14, 2011

I am trying to create a custom object which will display particular graphics at a particular time (when the movie tells the object to show something). Well I made my object (the way I thought it would work) and I encountered a problem when I called graphics functions from the main movie.

I made a very stripped down version of the same object to test and see what was going wrong. Apparently, I can call "Draw()" directly from inside the constructor and it will use the draw methods, but I cannot call it from the movie (like in the script below) and I can't call it from another function in the object if that function is not called during the constructor.

The question is... am I doing this right? The simple version of my end goal would be to create this object and have a function that I can call in the object something like "DrawImage(imagePath:String)" and it will use the graphics to draw the image.

In the movie:
----------------------------------------------

ActionScript Code:
import com.experimental.DynamicSprite;
import flash.display.Sprite;

[Code].....

View 2 Replies

ActionScript 3.0 :: Knowing What Has Been Drawn In Graphics Object

Jul 17, 2009

Lets say I have a customMovieClip. I sometimes draw an ellipse with customMovieClip.graphics and sometimes a rectangle. Now I want to know what was the shape ( ellipse/rect) that was created using a particular graphics object. Doing this would enable me to pinpoint what exactly to do with that customMovieClip() instance.

View 3 Replies

ActionScript 3.0 :: Graphics Item A Null Object In Other Functions?

Mar 26, 2009

OK, so I have code making a new graphics item and calling it sliderBar:

Code:
var sliderBar:Shape = new Shape();
sliderBar.graphics.lineStyle(2,0xFFFFFF,1,true);

[code].....

View 4 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

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

Flex :: Give A Depth To An Object Created From Graphics?

Apr 18, 2011

I am drawing some lines in my program using

graphics.lineTo(xx, yy);

The program has a background image over which these lines are drawn.The problem which I am facing is that the image overshadows the lines and the lines are not visible to the user.Since these lines do not have an id, I am not sure as to how I can assign a depth to them?

View 2 Replies

ActionScript 3.0 :: Determine Current Pen Position In Graphics Object?

Jan 3, 2010

Is there a way to determine the current position of the pen in a graphics display object. Something similar to what is discussed in this thread but for AS3?

View 4 Replies

Flex :: Where In Framework Graphics Object Passed Around To Achieve Drawing

Oct 23, 2009

I'm trying to understand how the Flex framework draws objects (Button, Label, Image, etc.). The Button class seems to draw itself by addChild()ing its ProgrammaticSkin. However, where in the framework is the Graphics object being passed around in the hierarchy to achieve the drawing. I want to get to the level of 2D API.

View 1 Replies

Actionscript 3 :: Flash : Read Data From Shape/graphics Object?

Dec 2, 2009

I am wondering if it is possible to get the data that is stored in a shape/graphics object in flash using actionscript 3?

In my project I would like to be able to draw a shape and then read all the points in that shape into my script. The reason for that is that I need go generate lines from those points that I later can use to check if my characters velocity intersects with any of them.

View 3 Replies

Actionscript 3 :: Possible To Export A MovieClip Or Graphics Object To A Vectorial Format?

Oct 22, 2010

I want to export some vectorial drawings to a vectorial format (eps, svg,...) from a Flash application. Everything is vectorial in my application so it should be possible to do it, but I can't find a solution

View 1 Replies

Flex :: Graphics - Filling Color In An Object Built Using Primitives

Apr 22, 2011

I have a bounded object, created using primitives lines in Action Script- either an oval or a triangle. Is there any way I can fill the contents in a specific color

Just to clarify on this- the shape could be in two ways

a) drawing a isoceles triangle based on a variable apex angle

b) two curved lines to form a "lens"

I am not sure if I can use the fill function, as I am not drawing a inherently bounded shape- the closed nature is based on my calculations

[Code]....

View 3 Replies

ActionScript 3.0 :: Flash Clearing Graphics Object Of Sprite When Dispose Off

Jan 29, 2012

When I'm disposing a sprite which has drawings on its graphics object, Do I need to use "graphics.clear()" or is "mySprite = null" is enough?

View 3 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 2.0 :: Attach Graphics Instead Of MC Cause A Graphics File Size Is Relatively Small Than That Of A Graphic?

Apr 9, 2005

I was wondering about MC and hey can help to lag a game out. I set up an advanced class system so i don't have to use MC to simulate walls, all i use isthe x,y,width and height. Well anyway since i don't need MC anymore I was wondering if there is a way to attach Graphics instead of MC cause a Graphics file size is relatively small than that of a graphic, I think. If anyone could tell me thats true and show me a way to attach graphics that would be nice. I haven't tried it yet but maybe if I exported the graphic from the library imihgt be able to call its name, but it doesn't have an instance name so im stuck.

View 2 Replies

ActionScript 3.0 :: 1119: Access Of Possibly Undefined Property Graphics Through A Reference With Static Type Flash.display:Graphics.

Oct 8, 2009

i am trying to receive in my function as a parameter either a shape or a sprite and then access their graphics property, but this gives me an error:

Code:
public static function makeRect( obj:DisplayObject, ...
var g:Graphics;
if(obj is Sprite){

[code]...

//1119: Access of possibly undefined property graphics through a reference with static type flash.display:Graphics.

View 1 Replies

Flash :: Why Does The Animation In A Library Object Not Play When It's A "Graphics" Item

Feb 10, 2012

Is there any way I can determine why an animation in a "Graphics" library object of 10 frames length does not play if the main time line has only 1 frame? When the same item is changed to "MovieClip", it plays fine, regardless of the number of frames!

View 1 Replies







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