Flash - Color Under A Point Or From A SHAPE?

Mar 19, 2011

I am using flash as3.I have some shapes I have drawn on the screen. They are made using:

graphics.beginFill(0x00ff00);
graphics.drawRect(0,0,50,50);
graphics.endFill();

to draw them. Each shape has a different color for fun (different beginFill).How can I get the color of the shape under the mouse pointer as I move the mouse around the shapes?I see two choices so far but don't know how to do either of them: Get color under the mouse point get the color from the shape properties (preferred)how to do either of these...

View 3 Replies


Similar Posts:


Flash :: Check Whether Line From Point(x1,y2) To (x2,y2) Intersects This Shape?

Mar 11, 2011

Given a MovieClip containing a vectorshape (loaded from the library) - is there a way to check whether a line (from point(x1,y2) to point(x2,y2) intersects this shape?

View 1 Replies

Flash :: CS5 Wont Let Me Fill A Shape With Color

Dec 12, 2010

I am currently learning to use flash and i am following the ebook guide. On lesson 2 at the end, it requests you to select a complex shape, go to the bucket option and change the fill colour to dark brown. I tried that but the fill option has a red line across it and it cannot be selected. I need to complete this step if i want to finish lesson 2. I tried different things but it seems like the shape cannot be edited. I looked and it is not locked.[url]...

View 2 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 :: Make A Flash Shape's (x - Y) Coordinate Relate To Not Its Starting Point But Its Location On The Frame

Feb 14, 2012

Alright, so I've been struggling with this one since last night. When I create a new object (a new unit), and draw it to the screen (Flash does all the work there), the point at which it's first placed is considered its origin. That is, getX and getY will return the distance from that point... Why is that? Or how can I stop this?

[Code]...

View 2 Replies

ActionScript 3.0 :: Get X , Y And Z Positions Of A Point In A Shape?

Jan 5, 2010

Is there any way to get the positions of points in a shape on stage at runtime? for instance a triangle, is there any way to get the positions of the 3 points that make the triangle?

View 2 Replies

ActionScript 3.0 :: Shape And Reg Point Inside A Parent?

Nov 24, 2009

draw a shape on the stage, make it into a movieclip, registration point wherever, tl is fine, name it mc, and put his code:

trace(mc.getChildAt(0).y);

now get inside a movieclip and move that shape around (away from registration point) for example above registration point, or wherever and output will always be 0.

View 6 Replies

ActionScript 3.0 :: Make Shape Rotation At It's Center Point?

Jun 14, 2011

I draw a shape,like follows:

var shape1:Shape;
shape1=draw();
addChild(shape1);
shape1.rotation=50;

[Code]....

Then I want to rotate the shape at it's center point(200,202) by using shape1.rotation=50,but I find the shape don't rotate at the the center of it's shape. How to realize the function which make shape rotate at its center point?

View 4 Replies

ActionScript 1/2 :: Finding The Minimum Y Point In A Complex Shape In A Given X Coordinate?

Dec 1, 2010

I´d like to know if it´s possible to find a minimum y point (where the shape ends) of a shape, in a given x coordinate.
 
Example: I have a complex shape like a big "S". Suppose the "S" minimum x coordinate is 0. How can I find the minimum y point of the "S" (again, where the shape ends) in the x coordinate of 14?
 
Here is the image: I need to find the y coordinate (or point) of the blue point in the image. 

View 11 Replies

ActionScript 3.0 :: Draw A Shape With A Registration Point Bottom Left?

Sep 14, 2009

I need to have 2 kinds of masks, one with a registration point in the top left so that when I tween its height it expands downwards, and one with a registration point in the bottom left so that when I tween its height it expands upwards?how do i do that, with code ofcourse?i have made something but i dont know if its the right way:(this expands downwards, but i dont know how to get it to expand upwards)

Code:
import gs.TweenLite;
var subMask:Shape = new Shape();

[code]......

View 4 Replies

Actionscript 3 :: Point Closest To Combined Geometric Shapes (compound Shape)?

Feb 20, 2012

I have a single point and a set of shapes. I need to know if the point is contained within the compound shape of those shapes. That is, where all of the shapes intersect.But that is the easy part.If the point is outside the compound shape I need to find the position within that compound shape that is closest to the point.These shapes can be of the type:squarecirclering (circle with another circle cut out of the center)inverse circle (basically just the circular hole and a never ending fill outside that hole, or to the end of the canvas is there must be a limit to its size)part of circle (as in a pie chart)part of ring (as above but lineThe example below has an inverted circle (the biggest circle with grey surrounding it), a ring (topleft) a square and a line.

If we don't consider the line, then the orange part is the shape to constrain to. If the line is taken into account then the saturated orange part of the line is the shape to constrain to.The black small dots represent the points that need to be constrained. The blue dots represent the desired result. (a 1, b 2 etc.)Point "f" has no corresponding constrained result, since it is already in the orange area.For the purpose of this example, only point "e" is constrained to the line, all others are constrained to the orange orange area.

View 3 Replies

Bones: Change The Color Of An IK Shape?

Sep 17, 2009

an animation created with the Bones tool. I'm using a bone system to deform a shape.In the meantime I decided that the color of the IK shape should be other than the current one. Nonetheless I can't find a way to change its color while maintaining the shape within the armature.

View 1 Replies

ActionScript 2.0 :: Change Color 187 Shape

Dec 21, 2010

i have 187 movieclip and i need change shape color every movieclip. every movieclip have 7 shapes in 7 different frames. in other words i need to change 1309 shape color. houston i don't want do that

View 1 Replies

ActionScript 2.0 :: Change The Color Of A Shape Though Xml?

Aug 6, 2008

is it possible to change the color of a shape though xml?

View 1 Replies

ActionScript 2.0 :: Do Color Shape Tweens?

Jan 20, 2005

i'm doing a project that i need to do color shape tweens and i'm doing it the stupidest way but it's the only way that i know.. i'm doing all the probabilities but i'm sure this can be done easily with action script. in this example that i'm show i only have 3 colours but in my project i'll need to use 6 colours and 5 diferent objects and it makes a lot of probabilities [URL]

View 1 Replies

ActionScript 3.0 :: Draw A Rectangle Or Circle Shape With Mouse And Scale By Setting The Point?

May 11, 2009

I want to make an editor like this site. [URL] If you browse this link you will find "Button. If you press this button you will navigate to a editor to design your layout. After draw a rectangle or circle or line you can resize that or can rotate that. When you finish if press the "you will back to the previous page where your desinged layout display. If you press the "" again then you will navigate the editor with the previously designed layout. I want to make a site like this. I want to use the flash cs4 to make the editor. Anybody knows how to draw a rectangle or circle shape with mouse and how to scale by setting the point and how to rotate by setting the rotation point also by using flash cs4 and as3?.

View 3 Replies

ActionScript 3.0 :: Creating A New Instance And Color A Shape?

Oct 14, 2010

I'm currently working on a little practice .fla file I've been working on. What I have now is an altered version a 'game' I made recently. I wanted to see if it was possible to create a new instance and color by having the user drag the object into the black (target) area. In short I want the user to drag one of my shapes (movieclips) and while keeping the original shape in place, move the copy version into the target and have the copy change to a different random color.  
 
var counter:Number = 0; 
square.addEventListener(MouseEvent.MOUSE_DOWN, moveObject);
square.addEventListener(MouseEvent.MOUSE_UP,releaseObject);
circle.addEventListener(MouseEvent.MOUSE_DOWN,moveObject);

[code]....

View 2 Replies

ActionScript 3.0 :: Get Color Of Drawn MovieClip / Shape?

Oct 3, 2009

I am having a problem getting color value of MovieClip's color on stage. This movie clip contains simple colored square drawn by Rectangle Tool.[code]...

View 0 Replies

ActionScript 3.0 :: Tween The Color Of An Existing Shape?

Sep 6, 2010

Is there anyway to tween the color of an existing shape?

View 1 Replies

ActionScript 3.0 :: Cannot Check What Color Is Filled In A Shape

Oct 17, 2010

i can set color of shape easily via shape.transform.colorTransform..... etc its unbeleiveable, what color is already filled in a shape??

i know, i can draw a bitmap on top of it and get pixel data from that... but

1- it seems lengthy approach ( lazy enough, don't want to write few more lines)

2- it confuses, because if i don't want to get color from pixel but i know one flat color is filled?? but shape is strange / arbitrary / random... how can i confirm that specific pixel has some color or not??

i just wanted to know what flat color is filled inside a shape(very edgy...)

View 0 Replies

ActionScript 3.0 :: Pick Color In Shape At Pixel 0,0?

Feb 10, 2011

is it possible to pick the color of a uni filled shape? If not, is it possible to retrieve the color at pixel x:0 y:0?Otherwise how do I pick that pixelcolor using bitmapdata.

View 2 Replies

AS :: Professional - Change Color Of Vector Shape In Library?

Jul 7, 2010

I am working on a project that some one else created. There were very orgainized, but my question is this: There is a starburst shape, and in the property inspector it is labeling as yellow burst, and that's how it shows in the library. But one instance of it is red in the movie, and I can not find it to change or delete as they called everything dynamically. how this was done, or how I might locate this object?

View 3 Replies

Professional :: Changing The Color Of A Shape As It Moves And Scales?

Oct 18, 2010

I have a symbol of a shape with a gradient drawn in Illustrator that I copied-and-pasted into Flash CS5. I created a simple motion tween by making the symbol move around the stage and scale. How do I now change the color of the symbol as it is moving on stage?

View 4 Replies

ActionScript 3.0 :: Programmatically Read Shape Fill & Stroke Color?

Sep 8, 2010

Somehow, I've been unable to figure out exactly how to do this, even though I suspect it should be dead simple! All I want to do is read the colors of the fills & strokes on some objects I've imported from Adobe Illustrator. They have very specific colors applied to them, such that I can parse them (hopefully!) and know what to do with the objects based on their unique color.

View 7 Replies

ActionScript 3.0 :: How To Get Lines To Change Color Or Bucket To Apply To Shape

Aug 21, 2011

I have Flash CS5 and cannot get the pencil or in k tool to change color it stays at the layer color only. When I make a shape and pick paint bucket tool it will not add the color I am choosing.

View 1 Replies

Actionscript :: Fill Solid Color Into The Shape Of A Transparent PNG File?

Apr 11, 2012

For example, I have a transparent png file, the shape is a car.In the png file, I only draw the white border shape.Outside and inside the border are all transparent.

I want to use actionscript3 code to show the car object with different color, it means only fill color inside the border, and for the outside of the border, keep transparent.How to do that?

So far, the simplest workaround is to prepare many images with PhotoShop, but it's not good enough for me. When I have many shapes and use many colors, I've to prepare many many images.Add more details:(Because I'm using white border, you may not see the basic png file if your background of browser is white)

View 2 Replies

ActionScript 2.0 :: Edit Fill Color Of Manually Created Shape?

Aug 24, 2010

Say I draw a square on the stage, with a fill of blue and a stroke of black. My width and height are both the same. Now, in my Actionscript, I want to change that blue fill to something else.... on some off the wall condition of course.

Better yet, imagine I draw this extremly elaborate polygon out. How could I change it's fill, dynamically, in Actionscript (AS2 preferably, but I'm just lookin' for logic here)

View 1 Replies

ActionScript 1/2 :: Getting A Color On A Point Of The Stage?

Dec 12, 2009

Im making a shirt designer application for a companys website, and I need flash to make a bitmap of the shirt using the 'BitmapData constructor'.This sounds easy. Create the bitmap, and use a loop to set all the pixels to the color behind it.But what functions can I use to find the color of a single point on the document?

View 7 Replies

Flex - Find The Color Of A Pixel At A Point Within A VGroup?

Jul 29, 2011

I'm having trouble with this code

var imageMap:ImageSnapshot= ImageSnapshot.captureImage(object);
var pixelValue:uint = imageMap.bitmapData.getPixel(x, y);

View 1 Replies

ActionScript 2.0 :: Get The Color Code At A Point On The Stage Or In A Movieclip?

May 9, 2005

is it possible to get the color code at a point on the stage or in a movieclip with actionscript? (like an eyedropper tool)

View 1 Replies







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