ActionScript 2.0 :: Drawing API - Attach MovieClips And Draw Lines Between Them

Oct 29, 2005

I was screwing around one day and thought I'd make a little line-drawing-thing. Basically it just attaches movie clips and draws lines between them using the drawing API. That was the easier part. Now I though I'd take it a step further and add some curves. I tried but the attached file is the best I could think of.

square.fla is the original file
lineCurve.fla is the file in which I tried to add curves.

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Flash Drawing API Draw The Curved Lines?

Jun 17, 2011

I made this one poor class that has a public function which draws with a single loop a shape with curveTo() function (I tested one option to draw straight lines with lineTo() and only curved lines with curveTo() function but in my opinion, that lineTo function where a bit slower, at least in my implementations of testin speeds).I sent to it four parameters (anchor points and the control points) as many times as there were some corners to draw and everything seemed to go well untill I checked which way is faster to draw single rounded rect. Flashs own way beats my version up with huge 120 m/s distance already in some 100 000 iterations. The format of data I tested to send to my class function to draw that goddamned thing were numbers in arrays, numbers in objects and numbers in my own class objects like linked list and the file that holds just four numbers included in arrays or linked list. And two separate arrays, one for anchor points and one for the control points, with just Point Objects were fastest (if I remember correct) way but still that 120 m/s slower than Drawing API in Flash.My function in the class where something like:

ActionScript Code:
public function drawShape(points1:Array, points2:Array, lineOn:Boolean = false, fillOn:boolean = false, lineThickness:Number = 1, lineColor:uint = 0, lineAlpha:Number = 1, fillColor:uint = 0xff, fillAlpha:Number = 1):void{[code]..........

View 7 Replies

Actionscript 3.0 :: Draw Lines With Flash's Core Graphic Class But Attach A Custom Bitmap To That Line?

Mar 31, 2009

[URL]

Are they just constantly adding MC's to the display list as the mouse is moved around? Doesn't that kill memory?

Is there a way to draw lines with Flash's core graphic class but attach a custom bitmap to that line?

View 10 Replies

Actionscript 3.0 :: Blitting Lines - Draw Approximately 50000 Lines And Performance Is Poor?

Aug 17, 2011

I have been working on a map viewer based blitting technique. As part of the map I need to draw approximately 50000 lines and performance is currently really poor.

Code: Select allvar movie:Shape = new Shape();
for( ... )
{
movie.graphics.clear();[code].....

View 2 Replies

ActionScript 3.0 :: Drawing Lines Between Mc's, Getting Lines In Stage Co-ords, Not Mc's?

Nov 15, 2009

My code is on the main timeline.I call a function loop to draw lines between them.The lines are drawing between the right x, y values BUT between those values on the main stage, not those values within the kite.For example, dot1_mc is at x100, y0 inside kite. the line that should go from its center, draws from stage x100, 0.How do I draw the lines inside kite so that they draw between the dots?Heres my code that draws the linesPHP Code:

function loop():void{ lineDrawing.graphics.clear(); var a:Point = new Point(kite_mc.dot1_mc.x, kite_mc.dot1_mc.y); var b:Point = new Point(kite_mc.dot2_mc.x, kite_mc.dot2_mc.y); var c:Point = new

[code].....

View 4 Replies

ActionScript 2.0 :: Draw Lines With It?

Oct 8, 2003

I am trying to have a line draw in my movie with actionScript...

have made three lines.

if I want line 1 to draw.... then..... line 2.... then line 3

do I put the script on three separate frames ?

and.... right now... they are just there...

how do I make it like an animation where the line starts at the edge of my movie draws line 2 changes direction draws line 2 changes direction draws line 3 then stops.

View 13 Replies

ActionScript 2.0 :: Can't Draw Lines

Sep 30, 2008

anyone know why this isnt drawing lines for me?

[Code]...

View 2 Replies

IDE :: Pen Tool Can Only Draw Lines?

Apr 16, 2009

Just opened flash for the first time to find that the pen tool will only draw straight lines.It can still plot points and the lines will join up but curves are impossible.Is there some setting that disable drawing curves? I haven't found anything in the annoyingly-online files.

View 2 Replies

Flex :: Drawing Lines Between Shapes?

Jan 24, 2011

I have one left panel in which there are different shapes like start,end connectors..... when i drag line image inside canvas i want to draw line/connector between two shapes how would i do it

View 1 Replies

ActionScript 2.0 :: Drawing Lines From One Movieclip To Another?

Jan 23, 2004

I am making a movie clip and want to draw lines from one movie clip to another to make it look like connectors on a flowchart. How do I use the returned values using a getbounds() method to draw a line from movie clip A to movie clip B. how the xMin, xMax, yMin and yMax values translate to finding the 4 corners of a rectangular movieclip. Can I use these values to draw lines from the movieclip using lineto().

View 11 Replies

ActionScript 2.0 :: Drawing Lines In Flash?

Apr 17, 2009

I'm trying to design an application where you can draw lines. This is my code.

Code:

onMouseDown = function (){
original_x = _root._xmouse
original_y = _root._ymouse

[Code].....

value_obtained is true when you click the mouse, and is made false when the mouse is released. original_x and original_y are the coordinates for the point of the first click.

How can I make it so that each created line stays on the screen and is not remade?

View 1 Replies

ActionScript 2.0 :: Drawing Lines In Movie?

Oct 8, 2003

I am trying to have a line draw in my movie with actionScript...have made three lines....if I want line 1 to draw.... then..... line 2.... then line 3 do I put the script on three separate frames ?and.... right now... they are just there...how do I make it like an animation... where the line starts at the edge of my movie.... draws line 2... changes direction... draws line 2.... changes direction.... draws line 3.... then stops.

View 11 Replies

ActionScript 2.0 :: Drawing Lines From One Movieclip To Another

Jan 23, 2004

I am making a movie clip and want to draw lines from one movie clip to another to make it look like connectors on a flowchart. How do I use the returned values using a getbounds() method to draw a line from movie clip A to movie clip B. Can some one show an illustration explaining how the xMin, xMax, yMin and yMax values translate to finding the 4 corners of a rectangular movieclip. Can I use these values to draw lines from the movieclip using lineto(). If so how do I do that?

View 11 Replies

ActionScript 2.0 :: Drawing Lines Without Using The Mouse At All

Oct 25, 2002

I wanna draw lines, without using the mousse at all. Straight lines or Sinusoids, it doesn't really matter. I've found a relevant tutorial here: [URL] but I didn't manage to make it work. Basically didn't fully understand it.

View 3 Replies

Flex :: Draw Lines In Canvas?

Dec 13, 2010

I'm trying to draw lines on a canvas object. When the width of the Canvas is less that the width of the line, it draws outside the Canvas over other elements. I read about this problem and I try to resolve using a inner Canvas with a longer height so a scrollbar appears.But I also read that this problem can be correct using a mask but I do not know what is the better way. Which do you recommend?

<mx:Canvas id="panelContentECG" width="100%" height="400" backgroundAlpha="0.5" styleName="miCanvas" borderStyle="solid" cornerRadius="20" borderColor="0xFCFE00" horizontalScrollPolicy="off">

[code].....

View 1 Replies

IDE :: Draw Lines With Exact Length?

Apr 15, 2010

I would like to have a possibility, where a user could draw simple lines, but with exact length (5000mm, 3150mm, 3950mm etc).where a user could just click and see the lines. Together these lines would make a floor plan for a house. These lines don't have to have thickness, because it will be just a sketch where walls are located. After user has drawn the sketch i would need the program to generate a text file with coordinates of the lines.

View 3 Replies

ActionScript 2.0 :: How To Draw Aliased Lines

Mar 25, 2005

how to draw aliased lines through actionscript?

View 3 Replies

ActionScript 2.0 :: Drawing Dynamic Straight Lines?

Feb 9, 2010

drawing a straight line, just like on the flash game Line rider. I need to be able to create a line by dragging it with the mouse.

View 3 Replies

ActionScript 3.0 :: Drawing Lines And Buttons In AS3 Dynamically?

Sep 16, 2011

I have 4 coordinates from which i created a rectangle(using lines). I also created buttons dynamically. It works great for straight line. But when the coordinates generate diagonal lines im having a problem in making it go below the lines or fitting it inside the figure.See my pic for better understanding. I have also figured out how to rotate the button. Here is my screenshot:Here is my code: To generate the lines:

Code:
var myLine:Shape = new Shape;
myLine.graphics.lineStyle(1, 0xFF0000, 1);

[code].....

View 1 Replies

ActionScript 3.0 :: Drawing Lines Between A Set Of Objects In An Array

Sep 23, 2011

I have a set of small circles(balls) on the stage, contained in an array. The array at different times in times in the program could have ballArray.length=1 or ballArray.length=125 or 48 or 0, etc.The balls float around the stage randomly too.I wish to have a function which will draw a line between all the points(balls or circles) in that array.So for example where there is 0 or 1 balls, there would be 0 lines drawn.Where there is 4 balls there would be 6 interconnections. as there would be six lines linking every object to each other object , exactly once per tick in the animation.[code]

View 3 Replies

ActionScript 2.0 :: Drawing Lines Ontop Of An Image?

Oct 21, 2004

I have an empty MC. I want to draw lines that show on top of an image, but everything I try draws the lines below my image.This code is ran from the main timeline.This is my code so far.

Code:
_root.attachMovie("Audiogram_Chart","Show_Audiogram",100000); //this is my MC that will hold the graphics
_root.Show_Audiogram.attachMovie("Audiogram_Chart_Pic","Audiogram_Chart_Pic1",0); //this is a graphic with linkage
_root.Show_Audiogram._x=200;
_root.Show_Audiogram._y=200;

[code].....

View 1 Replies

ActionScript 2.0 :: Drawing - How To Remove Lines If They Overlap

Feb 17, 2006

Im using FLash MX 2004, and am creating lines using move to and lineto in an empty movie clip...is there a way to delete lines if a new one intersects, if theres an overlap...or if theres more than say 5 lines on the screen?

View 2 Replies

ActionScript 3.0 :: Drawing Diagonal Lines For A Background?

Aug 20, 2009

Drawing diagonal lines for a background, any one know how to do it?

View 4 Replies

ActionScript 3.0 :: Cannot Get The Lines To Draw Onto The Top Of The MovieClip Box_mc?

Jan 14, 2010

I cannot get the lines to draw onto the top of the MovieClip box_mc.At this pojnt, my solution is to change the alpha of box_mc to 0. Now I can see my drawings which are under the box_mc but keep within the boundries of the MovieClip.Maybe my thinking is too concrete, but I was trying to get the drawing lines to stay on top of the MovieClip box_mc like it was a small drawing board.I have tried place a reference to the stage in various places and use addChildAt() in order to see f I can change the MovieClip's place in the hierarchy but so far nothing has worked.

Attachments:
PencilDrawingApp.fla.as.zip (686 bytes)

View 4 Replies

Professional :: Draw Simple Lines And Shapes?

Feb 28, 2012

This question was posted in response to the following article: [URL]..

View 6 Replies

Actionscript 3 :: Draw Smooth Lines In Flash?

Jun 21, 2010

How can I draw smooth lines with actionscript 3 (using flex 4)?

[Code]...

View 1 Replies

ActionScript 3.0 :: Draw Straight Lines With Mouse?

Dec 2, 2009

I am trying to create a flash movie (AS3) that would allow the user to draw using his mouse but straight lines only. The user would click to set the start point of the line then as he moves the mouse around the line would move with the mouse until the user clicks again to set the end point. When the user clicks again a new line is created without deleting the previous one.

View 3 Replies

ActionScript 2.0 :: Draw Lines Only In A Special Place?

Mar 22, 2010

I have three functions that are drawing lines[code]...

I want the functions to work only when the mouse is in a special place on the scene, not drawing lines outside that place.

View 2 Replies

ActionScript 3.0 :: Draw Lines And Buttons Dynamically?

Sep 16, 2011

I have 4 coordinates from which i created a rectangle(using lines). I also created buttons dynamically. It works great for straight line. But when the coordinates generate diagonal lines im having a problem in making it go below the lines or fitting it inside the figure. See my pic for better understanding. I have also figured out how to rotate the button.[code]...

View 1 Replies

ActionScript 2.0 :: Draw Random Lines On Stage?

Feb 20, 2012

my requirement is that i want to dynamically draw lines on stage using actionscript only;

the end of each line should be the starting point of the next line. all lines will be of random different lengths, heading in random different directions...

but all line should stay in the bounds of the stage i.e. if the stage is 1024 X 768, lines should not go way out of these dimensions...

View 5 Replies







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