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


Similar Posts:


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

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 :: Read & Apply Bezier Anchor Point & Handle Positions To Different Anchor Points?

May 25, 2010

i'm a novice to ActionScript but from failed Google function searches, i think i've choosen an advanced i hope possible task: how to read then apply bezier, anchor point and handle positions to different anchor points. What i need to do is precisely align a rectangular closed bezier path with a randomly shaped closed bezier path, both with the same number of anchor points.

View 9 Replies

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

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

ActionScript 2.0 :: Why Emptymovieclip Positions Affect Positions Of Thumbnails

Jan 22, 2007

I have thumbs placed on the stage. I create an empty mc to load swf. But my thumbs disappear from the stage when I test the movie ( html or swf) if I settle the _ and _y position of the empty mc.why the emptymovieclip positions affect the positions of my thumbnails?

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

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 :: Change Shape Of Circle By Dragging Point On Circle

Mar 16, 2012

I want to create circle, and put 8 points on it. So, user can drag each point in order to change it's shape.

Is there any way to do this in flash?

I have some following code:

Ref. - How to draw a continuous curved line from 3 given points at a time

package{import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.geom.Point;

[Code].....

So, can anyone convert these three point curve line to 8 points circle?

View 1 Replies

ActionScript 3.0 :: New Shape - 1046: Type Was Not Found Or Was Not A Compile-time Constant: Shape

Nov 30, 2009

ActionScript Code:
package {
import flash.display.MovieClip;
public class Base extends MovieClip {
public var baseHP:int = 50;
var newRect:Shape = new Shape();

1046: Type was not found or was not a compile-time constant: Shape. 1180: Call to a possibly undefined method Shape. What does it mean by "undefined method"? I am somewhat of a newby, so sorry if there are any stupid errors

View 1 Replies

Professional :: Adding Shape Hints Makes Shape Disappear In Between Frames

Jun 22, 2010

Whenever I add shape hints to a shape tween the shape disappears in the between frames. I am using CS5 on Vista. I using files from [URL]to practice.

View 2 Replies

ActionScript 3.0 :: Draw The Shape Of A Existing Movieclip Which Is Irregular Shape?

Oct 11, 2011

need to draw the shape of a existing movieclip which is irregular shape.

View 2 Replies

ActionScript 3.0 :: Draw The Shape Of A Existing Movieclip Which Is Irregular Shape

Oct 11, 2011

need to draw the shape of a existing movieclip which is irregular shape.

View 1 Replies

ActionScript 1/2 :: Shape Colliding Another Shape, Not The Rectangleof A Movieclip?

Jul 9, 2009

Id like to know if there is a way to do a shape hitTest.Not as the normal hitTest would do, but shape colliding another shape, not the rectangleof a movieclip.It can be in a movieclip.

View 23 Replies

Professional :: Change The Shape Of A Shape?

Oct 19, 2010

using the shape tool you can draw basic shapesthen using the subselection tool you can re-shape them by relocating certain points

What i want to do is create a tween whereby one of the points is movedthe problem is you have to convert to a symbol first and after you have done that you cant change the shapes shape.so how do i go about using a motion tween to change the shape of a shape?

View 1 Replies

ActionScript 3.0 :: Pushing Point Locations Into An Array - Point(x,y) Conversion Faillure?

Dec 9, 2011

Im pushing Point locations into an array to Shift em out later. like this:

tempmoves.push([new Point(roundx,roundy)]);
..
ob.movestoplayer = tempmoves;[code]....

What am i doing wrong?

View 8 Replies

ActionScript 2.0 :: Movieclip To Move Along The X-axis To A Certain Point And Then Back To The Starting Point Again?

Apr 12, 2007

It's been a long time since I've done any work with actionscript, and alas I've forgotten nearly everything. I've tried to look for a tutorial that would explain basic animation with actionscript, but the one that I found on Kirupa was no longer there.

Basically I'd like to do this:On the stage I have a movieclip and I'd like the movieclip to move along the x-axis to a certain point and then back to the starting point again. The moving speed of the movieclip should also be adjustable.

View 8 Replies

ActionScript 3.0 :: Distance From Point To Point And Referencing Other Instances Of The Same Class

Feb 8, 2009

I'm creating a game in flash for a university project, and learning actionscript and programming as I go. I'm very much still at a beginner level - at the moment al I have is some actionscript for drawing rectangles and moving them about the screen. This is what I'm having trouble with at the moment: I have a class called 'Creature', and I want instances of it to interact with each other. I want them to do something when they come within a certain distance of another instance. And I want them to be able to pick a random other instance to get the location of, in order to do something with that information.

What I think I need is: A function for telling the distance between two (x,y) points.
A way of referencing the nearest other instance of the class. And a way of randomly selecting from all of the instances of the class.

View 4 Replies

Flash :: Perspective Projection Formula - Convert 3d Point To 2d Point?

Mar 27, 2011

How to convert 3d point to 2d point? I've found next formula in Internet(camera is situated in origin)

[Code]....

But these formulae give me strange result when z are less than zero(z<0) I need build line from A(100,100,100) to B (100,100;-100) As you can see these equations give really strange result when I try to convert B point in 2D dimension

View 1 Replies

Actionscript 3 :: Moving A Point With Rotation Doesn't Change The Point XY?

Jul 15, 2011

i have the follow issue :

I have a point which is setted at the border on a component, with changed transform point to the center of a component in order to match the component rotation.

the important part is when i try to get the point XY after rotation - they remains the same as before rotation.

how to get XY, after rotation ( changeing point.rotation property to specific degrees of rotaion )

View 2 Replies

ActionScript 2.0 :: A Line From One Point Past Another Point And Whether It Hits An Object?

Aug 19, 2009

I am using AS2 with Flash 8 Professional So, my problem is that I currently have a man in the middle of the screen, who shoots a line towards the mouse when I click. However, when I use hitTest to see if the line collides with another object, Flash recognizes the line as a large box if it is diagonal, so the hitTest isn't very accurate. The line only satys there for one frame, so I can't have the usual moving-bullet-style. I am either looking for a way to create an imaginary line with AS from the starting point to the mouse and beyond, and tell whether or not this line intersects with an object... or some other way that I haven't thought of to fix my problem. Keep in mind that the line rotates from a center point towards anywhere around it for 360 degrees.

View 1 Replies

ActionScript 3.0 :: Find Egistration Point Compared To Its Top Left Point

Aug 20, 2009

if i have a movieclip or a sprite could i find (via code) where is its registration point compared to its top left point (no rotation included) ?

View 4 Replies

ActionScript 2.0 :: Smooth Preload Bar - Appears To Jump From Point To Point

Apr 27, 2004

my preloader bar isn't growing smoothly. it appears to jump from point to point -- and i want to make it smooth. you can see the example here at: [URL] would anyone mind taking a quick look at the file i've attached,

View 6 Replies

ActionScript 2.0 :: Find An Angle From An Anchor Point And A Moving Point?

Feb 19, 2005

I know some basic trig. but how do i find an angle from an anchor point and a moving point?

adjecent = _root.anchor._x-_root._xmouse;
opposite = _root.anchor._y-_root._ymouse;
hypotenuse = ((adjacent ^ 2)+(opposite ^ 2)) ^ 0.5;

View 2 Replies

ActionScript 2.0 :: Move A Point (or Circle) Slowly And The Point Let Behind A Line?

May 3, 2006

How can I move a point (or circle) slowly and the point let behind a line.When the point turn back the line will be erase.

View 8 Replies







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