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 ...
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.
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.
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?
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.
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):
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 ?
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
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.
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]...
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); }
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.
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.
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.
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.
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.
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;
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.
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);}
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
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.
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.