Creating A Line Between 2 Points?

May 20, 2009

I want to create line between 2 points ...such tht the line will start when i click the point A then i will drag the line by holding it to point B and i will join the line to point B by clickin on point B (somethin like the pen tool) ..then line will then be joined between the points ...

View 1 Replies


Similar Posts:


Actionscript 3 :: Calculating Evenly Distributed Points On A Line Of Points

Oct 3, 2011

I have been tasked with trying to create a drawing tool that draws dotted lines as you drag the mouse across the stage. I can easily capture the points on MouseEvent.MOUSE_MOVE and store them in a vector and then draw the points as dots:

The problem is that I need to calculate evenly distributed points on an ever growing Vector of points so I can only draw the line between say every 5th point (say using modulus). I have been battling away with Bezier curve equations both Quadratic and Cubic but still can't quite figure out how to convert my Vector of points into an evenly distributed Vector of Points without sucking the life from the CPU.

View 1 Replies

Flash :: Using The Pen Tool - Line Automatically Connects Between The Two Points In A Straight Line

Jul 3, 2009

I'm in the process of teaching myself the components of the CS4 Design Premium package using the Adobe Classroom in a Book series. I'm currently going through the Flash CIAB and i've started using the pen tool. The task involves creating a wave like design across the stage. Whilst this in itself is simple, the final instruction is to click on the first anchor point to close the shape. In the illustration, the closed shape seems to automatically extend around the stage, however when I click on the first anchor point, the line automatically connects between the two points in a straight line.

Am I doing something wrong? The next step is to fill this area, but with the straight line effect that I am getting, this becomes impossible. I should point out that the instruction states that the pen tool line should extend off the stage. I have done this, but even then on clicking on the first anchor point the shape is closed incorrectly.

View 2 Replies

AS3 :: Flash - Get The Two Points Of A Line?

Oct 15, 2011

I have a component (link to Test class) which contain one line in it, and I put one point of this line to (0, 0).

Then drag it to Flash(fla), and get its Shape in AS3 like:

// in Test.as
// assume that the movie clip only contain one line.
var line:Shape = Shape(getChildAt(0));

And I can get one point of this line which is x and y of var line. But how to get another point of this line?

Edit:
Ignore component stuff above, here has another question but I guess it pretty much the same as the question above:

Draw a line from (0, 0) to (10, 10) and draw another line from (10, 0) to (0, 10), how to get those lines of two-point form in AS3?

If I access them as Shape then I get two similar shapes which have same x, y, width and height values. Does AS3 has some way to access line as a REAL line not just a shape? or does it has any way I can calculate it out?

View 2 Replies

ActionScript 1/2 :: Join Two Points With A Line?

Aug 25, 2010

I want to ask how do you join two points with a line using actionscript? The points would be constantly moving.

View 9 Replies

ActionScript 3.0 :: Find Points On The Line When Given The X Value?

Oct 28, 2010

I have a line that is drawn using the draw api. I need to find points on the line when given the x value, how would I do this. I know on the bezier segment I can just user the yForX() and get the value but not sure how to with just a straight line.

View 5 Replies

ActionScript 2.0 :: Create A Line Between Two Points?

Oct 23, 2009

I need to create a line drawn between 2 points. My actual idea is of joining 3 points with lines drawn dynamically(for a triangle).

View 1 Replies

ActionScript 2.0 :: Check All Points Along A Line?

Aug 20, 2009

I'm using Flash 8 and AS2 I am attempting to make some code that checks whether or not a line that rotates around the screen is hitting a movie clip. Here is my code (with comments explaining it):

[Code]....

View 3 Replies

Professional :: Anchor Points On Line Segments?

Feb 14, 2010

Closed path made with pen tool in Flash MX  comprises of line segments & curved segments both.While adding anchor points on segments it is noticed that pen tool adds anchor points on curvaceous segments but not on line segments. Why is it so ? Is their any way to accomlish this task ?

View 5 Replies

ActionScript 2.0 :: Find The Points In A Line (Math)

Feb 3, 2005

find a points in a line Actually i want to make some footsteps in a sand. The footsteps are dhynamically placed on the stage. How to find the points in a dioganal. see the image

View 1 Replies

ActionScript 2.0 :: Find The Points In Line (Math)

Feb 3, 2005

i'm trouble to find a points in a line Actually i want to make some footsteps in a sand. The footsteps are dhynamically placed on the stage. How to find the points in a dioganal.

View 1 Replies

ActionScript 3.0 :: Drawing A Squiggly Or Wavy Line Between Two Points?

Oct 19, 2008

draw a squiggly or wavy line in the MOUSE_MOVED event as the user clicks and moves the mouse.

View 1 Replies

Draw A Continuous Curved Line From 3 Given Points At A Time?

May 10, 2011

I am trying to draw a continuous curved line in flash. There are many methods but none of the ones I have found so far quite fit my requirements. First of all, I want to use the flash graphic api's curveTo() method. I DO NOT want to simulate a curve with hundreds of calls to lineTo() per curved line segment. It is my experience and understanding that line segments are processor heavy. Flash's quadratic bezier curve should take less CPU power. [code]...

View 3 Replies

ActionScript 3.0 :: Add Mc Over Some Points Of A Line Drawn With LineTo Method

Nov 1, 2010

this is the thing: Using "lineTo" i get a line drawn on stage when dragging a mc. Then i should have four mc (note1, note2, note3, note4) added randomly over this line. I mean, the line is drawn and then over some parts of this line, using x and y of some of the points drawn there, this movie clips should be added randomly. I can make the mc appear randomly, but always in the same point (mouseX, mouseY); i cannot access others x and y of the drawn line. This is my code (noteContainer is a sprite):

Code:
private function drawingAPI(event:MouseEvent):void{
sprite1.graphics.lineTo(mouseX, mouseY);
}

[Code]...

View 9 Replies

ActionScript 3.0 :: TweenMax: From Flat Line To Multiple Points?

Jan 11, 2012

I think it would be cool if the line started out as flat (i.e., y=_height/2 for all points) and then the y points of the line animate into place.I don't even know where to start with doing this in TweenMax/Lite... I've seen several code snippets that draw a line from left to right, but that's not what I want.

View 6 Replies

ActionScript 2.0 :: Trigonometry - Line To Continue After The Points In Both Directions And With The Same Steep

Sep 27, 2005

Is there someone who is good at trigonometry? I have two points punkt1 and punkt2 and a line that is drawn between them. Both points is dragable. I want the line to continue after the points in both directions and with the same steep. I have counted the steep between point1 and point2 and tried to continue to drag to a point with the same steep, but it doesnt succed.

[Code]....

View 3 Replies

Actionscript :: Assemble Array Of Continuous Points For A Contour Line Using Conrec

Mar 31, 2011

I am trying to implement contour lines in ActionScript using Conrec. I have looked at both the java and javascript implementation and am still stuck.URL...Conrec will take grid data and assemble continuous contour lines. The problem is that it does not necessarily draw those lines in a continuous fashion. For example, it will draw A->B and then C->B and then C->D instead of A, B, C, D, etc.The javascript implementation seems to be accounting for this and serializing the instructions into an array of draw points. Which is what I too want to accomplish in the end. That is it takes the instructions from the core Conrec logic (eg: A->B, C->B, C->D, etc) and organizes it into an A, B, C, D series. I think it will also return the series as a multi-dimensional array to accommodate broken lines (eg: [[A, B, C, D], [E, F, G]]). This last functionality is what I need to do in Actionscript.This last part is where I am stuck. Ignore Conrec for now (I have given up on finding an Actionscript implementation), how can I organize these instructions into a collection of serial points? When Conrec gives me "draw point from X->Y" how can I first check if X or Y are already in a series and append either X or Y (whichever is not in the series) into the series? AND if neither are in the series, start a NEW series with X, Y as the starting set. Then check subsequent instructions against all existing series and connect series if they now start and stop on the same point? Also, I need to be able to allow for a series to close itself (eg: A, B, C, A) -- a loop (is that even possible?!).

I'm not sure if there is a technical term for what I want to do beyond "concatenation". I also hope someone out there has done this with Conrec and can give me some pointers.In the meantime, I am going to continue to plug away at this and see if I can come up with something but I am not confident in my abilities.If you know another way to draw contour lines from grid data, I am open to alternatives. But I have to be able to implement it in Actionscript.

View 3 Replies

ActionScript 3.0 :: Flash Runtime Ignores Alpha Values When Iterating Over Points In A Line

Apr 15, 2011

I have a large-ish array of points.

The graphics object I am using has it's alpha value set to 0.1.

When these points are plotted iteratively, and the line being drawn overlaps another line drawn earlier, there is no visible change in the colour at the intersection.

If I draw the line differently, not using an array of points, the alpha is not ignored.

ActionScript Code:
public function render(e:Event):void
{
if (segmentsCollection.length > 0)

[Code].....

This all occurs on each ENTER_FRAME event until the array is emptied.

I have tried loads of options but the alpha is always ignored.

View 5 Replies

ActionScript 2.0 :: Creating Array - Called Points Shown As Undefined

Aug 14, 2004

I'm trying to create an array, and this is the code I'm using:
Code:
function create_spiral(len, rad, turns, num, theArray) {
theArray = [];
var inx = len/num;
var iny = ((360*turns)*(Math.PI/180))/num;
var inz = iny;
[Code] ....

And I'm calling it with:
Code:
create_spiral(200, 10, 3, 100, points)
ideally, I would then have an array, called points, which would be full of numbers. But when I run a trace it shows as undefined.

View 2 Replies

ActionScript 3.0 :: "attach" Textbox To Midpoint Of Line Between 2 Movable Points?

Dec 1, 2009

I have 2 points you can drag. A draw a line between them. I have a textbox that displays the distance between the 2 points. How can I have the textbox "attach" itself to the midpoint of the line and stay there as the points are dragged?a file is attached and you can see it here [URL]

PHP Code:

var item:MovieClip;
var dragOffsetX:int;
var dragOffsetY:int;
var itemOffsetXY:int;

[code]....

View 3 Replies

ActionScript 2.0 :: Make The Bar "snap To" Certain Points Along The Line?

Oct 19, 2005

I'm working on this sliding bar navigation thing , and I'd like to make the bar "snap to" certain points along the line.

View 5 Replies

ActionScript 1/2 :: Creating A Line With Nulls?

Aug 20, 2009

I am using actionscript 2.0 and I am  trying to develope a line in 3d space. When I try to create a line base off of two variables, it doesn't work.

[Code]....

View 1 Replies

ActionScript 3.0 :: Drawing API - Creating Line That Follows Mouse

Oct 19, 2007

I want to set a point to start my line from and have the other end of the line follow my mouse. Here's what I have so far:

Code:
var clip:Shape = new Shape()
addChild(clip);
stage.addEventListener(MouseEvent.MOUSE_MOVE, drawLine);
function drawLine(evt:MouseEvent) {
clip.graphics.moveTo(0,0);
clip.graphics.lineTo(mouseX, mouseY);
clip.graphics.lineStyle(1, 0xff9933);
}

But it's constantly drawing the line due to my mouse_move listener. I only want one line on stage - know what I mean?

View 8 Replies

ActionScript 2.0 :: Creating A Timeline (a Line With Numbers)

Apr 8, 2008

I want to make a timeline spanning the year -3000 up to the year 2100. I want it to have a prefixed width between the numbers, 100px, and it has to add up with 50 years every time.

View 3 Replies

Creating / Controlling Line Of Text Turned Into Button

Jul 8, 2010

How do I create and control a line of text that i turned into a button. I want to have a selected state built into the button. is that possible? Previously I created a light next to the text that changes color or highlights when the button had been selected, but I would like the text to change color when it is selected and have script that I can use to reset the button state when another button is selected.

Current button:
Actionscript Code:
S1.addEventListener(MouseEvent.MOUSE_DOWN,click_S1);
function click_S1(evt:Event):void {
Truck.gotoAndStop(16);}

View 2 Replies

ActionScript 3.0 :: Creating Line On Runtime Pressing Mouse Down

Dec 25, 2009

Basically I want the user to be able to create a line on runtime by first pressing mouse_down on the stage estabilisting the first xy points of the line and then move the cursor somewhere else to a different x, y co-ordinate where the user finishes the line by pressing the mouse_down button again. How to do this? I need it to be a straight line

View 9 Replies

ActionScript 2.0 :: Creating A Line Mouse Trailer That Fades Out ?

Apr 21, 2008

how to create a mouse trailer in AS2 that gives the effect of the mouse "drawing on the screen", and fading out after a short period of time?

View 9 Replies

Creating Neon Type Line Lights Effect On Stage

Jan 31, 2010

I am looking to create an effect this this: [URL] Or even were the lines come in as a group or lines do a moment and move off the stage again. Been trying to mask it but the problem is that the line vectors have no inside too them, just a pure line.

View 1 Replies

Flex :: Tool For Creating Line / Bars Charts From XML Data?

Oct 9, 2009

I'd like to create cool lines and bars charts dynamically, from xml data. Since I'm not an expert in Flash, I wanted to get a tool to accomplish this. So far, I've tried Flex Builder 3, but I can't figure how to draw the chart dynamically, as the xml data is constantly changing. I just see examples on the internet with xml like "Orange, Banana, Apple", when what I'd like to see is something like "......" and get each item's value and attributes to show in the chart.

View 1 Replies

ActionScript 3.0 :: Creating A Line Break In A Dynamic Text Field?

Aug 27, 2009

What is the syntax for creating a line break in a dynamic text field?

Similar to:

PHP Code:
<p>The cow<br />jumped over the moon.</p> 

View 2 Replies







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