ActionScript 3.0 :: Draw Line To Follow MC?
Aug 10, 2009I have moving movie clip on stage and I want to draw a line so that it fallows my MC.
PHP Code:
var sp:Sprite =new Sprite();
addChild(sp);
[code]......
I have moving movie clip on stage and I want to draw a line so that it fallows my MC.
PHP Code:
var sp:Sprite =new Sprite();
addChild(sp);
[code]......
I have moving movie clip on stage and I want to draw a line so that it fallows my MC
ActionScript Code:
var sp:Sprite = new Sprite();
addChild(sp);
[Code].....
The problem is that on EnterFrame keeps drawing the line from coordinates 500, 200, but I want just one line so it follows constantly my movie clip.
I need to be able to draw a thick patterend line between 2 points in AS3, I can't use the draw API because it doesn't all me to actually put detail (pattern etc) into the thickness of the line, I thought about perhaps using the line to create a bitmap version and then using that as a mask, but I remember many years ago seeing some examples that use a movieclip as a source for a line.
View 1 Repliesdraw a line on mouse movement, not the static line.
I am attaching a sample which is 90 degree bounded as it has been given in animation, I want to make this or such type through mouse movement.
I'm trying to produce a game that on mouse down a dotted line (or just a line) gets dragged out following the mouse until it is realized then it disappears.
View 1 RepliesI've managed to follow some drawing tutorias which work fine (mouse down draws a line everywhere you move mouse like MS paint).I would like to adapt this now if I can so that when a user clicks down, a straight line will follow their mouse until they click again and this releases the straight line. This should leave one line on the screen, then they are free to move their mouse and repeat the action again.
View 6 RepliesI want to create a line tool exactly like flash line tool. But the code that I am using shows the line when we release the mouse button. How can I show the lines while it is drawing[code]...
View 4 RepliesI'm making a very simple game that lets you draw a curve by hand (using lineTo to the mouse position on mousemove) but now, I need to check wether the line intersects wiith another part of the same line (e.g. a loop)
I first used an onrollover command, and that worked, but not always because the mouse moved too fast (same with hittest with mouse). Then I pre-drawed the line in another mc, used hittest on it, and if it wasn't intersecting, draw it in the real mc. But that didn't work because it used the bounds to test. I guess the best way is to use some mathematical formula, but that would mean I have to save all my coordinates in an array..
In my latest project I'm trying to have a line follow my mouse, I succeeded doing this with the LineTo and MoveTo functions this is what i have come up with [URL]if you will play with it for a while you will notice that sometimes the line is burned on the screen and just stays there,Another thing i want to achieve is that the line will be created out of a movie clip and will have animations and graphics in it insted of just plain color.
btw heres my code
package
{
import flash.display.*;
import flash.utils.*;
[code]....
I have a box that i made dragable by clicking at it. I would like a green line attached to a point in the frame and the other end of the line attached to the movieclip being dragged. Hope i made it clear lol.
How would i go about to achive this effect? If possible without having the line itself being within the dragable movieclip (because the dragable box is in more than one frame and i only want the line in one frame)
In my file, I've replaced the cursor with a custom cursor of a pencil.It roams around the screen and on mouse over, triggers various actions. While it moves, I'd really like it to draw, so the user has more of an active role in the narrative. Is there a way to do this?
View 9 RepliesI have created a line dynamically. The line can be moved and change sloop. I want a dynamic text to follow the line all the time.
View 0 RepliesI have a line that is 800 pixels long. The line is a gradual curve, that gets kinda steep at the end. I want this ball to go along the line. How do I make the ball move to the right, and stay on top of the line. All I have now is...
PHP Code:
onClipEvent(enterFrame){
this._x +=35;
}
Now I need to add something to make it follow the line. The instance name of the line is.... "line" without the quotes of course.
how I draw a line through a path line? An example I have a movieClip that is a pencil and it is moving through a path line, now I want to draw the line that the pencil draw.
View 2 RepliesI am tracing a line between two movieClips (called pontoA and pontoB) using the following code:
var my_shape:Shape = new Shape();
addChild(my_shape);
my_shape.graphics.lineStyle(4, 0xFFFFFF, 1);
[code]......
is there a way using AS3 to get objects to follow a path (a drawn line) or will i have to set waypoints?
View 3 RepliesI want to create a line tool exactly like flash line tool. But the code that I am using shows the line when we release the mouse button. How can I show the lines while it is drawing
Code:
this.createEmptyMovieClip("drawing_mc",this.getNextHighestDepth());
drawing_mc.lineStyle(1,100);
[code].....
How do I draw a line across the USA starting in San Francisco in frame 1, moving through Kansas City in frame 5, and then extending to New York in frame 10. By frame 10 I'd like to see the whole line, representing the whole journey I took in my car over summer vacation.
I can make a "dot" do this in flash (ie without leaving a line trailing behind it) but I don't know how to make the line "grow" across the USA over time.
how to draw a simple line? Im not using designer (which means i call Document class method that ouputs everything).
View 2 Repliesi am trying to create a line that can be draggable and extedable from start and end points of line.
View 1 RepliesThe Xml
<?xml version="1.0"?>
<root>
<route portStart = "USLAX"
portStartx = "2014"
portStarty = "433"
portEnd = "JPTYO"
portEndx = "1995"
portEndy = "456" />
[Code] .....
What is the simplest way to draw a 3d line? E.g. I want a vector from (0,0,0) to (50, 100, 50).Do I have to do it the old school way with maths or is there some new 3d drawing API? (I heard f10 had lots of new 3d stuff...)
View 4 RepliesI'm making a fishing flash game where you drop your hook off a boat and i want to draw a white line from the boat to the hook and the hook can move up and down so i want it to stay with the hook
View 1 RepliesI'm trying to draw this hint box and was wondering if anyone could explain to me how to draw a curved line like the one below in flash?
View 4 Repliesmake two movable buttons connected with a line. When changing position of any button you'll change look of the line of course I know how to draw a line but after MOUSE_DOWN, and I don't know how to remove an old one line, and how make this line t be shown all the time?
My code
btn2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler3);btn2.addEventListener(MouseEvent.MOUSE_UP,
[code]......
i need to draw a line at runtime, and i found this "myShape.graphics.moveTo(100, 100); myShape.graphics.lineTo(200, 200);" but don't know for sure how to declare myShape, i think it needs 2 lines to declare it properly, right?
View 3 RepliesHere is a video explanation:
[URL]
If I use the Pen tool and attempt to draw a line within a symbol, the anchor point on the other end of the line moves [out of my control] to the right. I'm not sure whether this is a bug or a feature, but I'm leaning towards the former; either way
Adobe Flash CS5Mac OSX 10.7.2
I want to draw a sharp ( not antialiased ) and dotted line with AS3 [code]...
View 2 RepliesI've got a simple flash file where I randomly place dots on the stage. I've used the lineTo() command to draw lines between the dots. Eventually I would like to place the dots in 3d space and draw lines between them then rotate the movie clip so you're looking around it. Is there anyway to draw a line in 3d space? either using lineTo() or another function?
View 3 RepliesI'm trying to draw a line that just keeps moving using just AS3. Like when a heart beat monitor flat lines. The reason is I'm adding this to arduino project so when you breath into an alcohol sensor the line will move up if you have been drinking. I just want to be put on the right path.
View 1 Replies