Flash :: Making Line ActionScript Using LineTo

Feb 21, 2012

I'm extremely new to flash programming, and suddenly my teacher give me assignment to make a flash about mirror reflection line. Here is my as code to draw a simple line after following some tutorial online.

[Code]....

View 1 Replies


Similar Posts:


Flash :: Erase A LineTo Line In AS3?

Apr 5, 2011

I have this file http:[url].... Basically lines gets drawn where ever I tween the animation.arrow MovieClip. What I'm wanting to do is be able to rewind the MovieClip and have the line erase its self step by step.

View 1 Replies

Actionscript 3 :: Flash Animated Line Drawing With LineTo And Tweenmax?

Apr 19, 2011

I'm trying to animate a line by drawing using tweenmax and lineTo, but flash seems a little confused about the coordinates of things. The lines are also drawn a little shaky. Here's my code:

var childArray:Array = new Array(sC0,sC1,sC2,sC3);
var curChild = 0;
function drawLines(){

[code]......

View 2 Replies

Actionscript 3 :: Get Ending Point Of A Line Drawn With LineTo In Flash?

May 10, 2011

I have drawn a series of lines using flash's graphics.lineTo command, and placed them in an array to be referenced later. Based on certain user interactions, the clips that hold these lines can be shifted to the right, causing the lines to move with them, no longer connecting to the point they originally connected to. So I need to extend the lines by the amount their parent clip was shifted (I've called this incVal). So what I need to do is find the point at which each of these lines ended at, and draw from that point to the left by incVal. How do I get that ending point of the line?

This is my code:

To draw line and add it both to the clip and to an array for future reference:

line.graphics.lineTo(localPoint.x,localPoint.y-10);
membersRef.addChild(line);
parallelArr.push(line);

[Code]....

View 2 Replies

ActionScript 2.0 :: Making Rectangle Via LineTo Method?

Oct 16, 2004

I found out how to make for example a rectangle via the LineTo method. But how can I change the size of this rectangle and SEE it changing (ie a tween), not jumping from one format to the other? I guess it has to do with using "elapsing time" in the actionscript? I find it hard to get info on this subject. Though it seems important because otherwise it is impossible to create animations.

View 5 Replies

Flex :: Difference Between <s:Line> And Graphics.lineTo()?

Sep 28, 2010

If I skin a button and use the AS3 graphice.clear() and graphics.lineTo and beginFill to create a shape, the button overlaps other items in the container.

When I use the and mxml to create the same shape, the button is neatly positioned inside the container.

View 2 Replies

ActionScript 2.0 :: Continues The LineTo Making A Realistic Skid?

Jun 12, 2005

i have seen it done before in a tutorial which i cant find anymore.what they did is that;

1. when space is pressed it begins a lineTo from the point of an object resembling the back left wheel.

2. from there it continues the lineTo making a realistic skid.

3. after a small amount of time the skids deletes.

View 13 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 2.0 :: LineTo Drawing A Single Line Using Animation

Nov 24, 2010

I am working on Drawing API. There is a movieclip on stage which I am animating using Tween class. I just want to draw a line from the initial position of a the movieclip to it's final position. I can draw line, but I can see the lines being duplicated each time the enterframe runs. I just want a single line do be drawn from the movieclip's initial position to it's final position.

Here is my code

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myTween:Tween = new Tween(circ0_mc, "_x", Strong.easeOut, circ0_mc._x, 0, 2,

[Code].....

View 2 Replies

ActionScript 3.0 :: Add Texture (image Fill) To A Line Drawn With Graphics.lineTo()?

May 15, 2009

I am trying to draw a  line from x1, y1 to x2,y2 and i want it to be a line that repeats a pattern from an image. All I can see is that you can only draw lines and change their color or thickness but I would like it to repeat an image. Is that possible or do i have to use a really long and thin rectangle with a bitmap fill?The problem is I am making a game where the user will be able to actually draw the line so i have to make it be created dynamically. The game fantastic contraption [URL] has in the game a feature where you draw lines of any length and position that are filed with a picture.

View 13 Replies

Actionscript 3 - Flash: Making A Jagged Line Grow?

Feb 11, 2011

I'm trying to figure out how I would make a line grow or fade in basically, such as in a line graph how it shows increasing growth as the viewer watches the line move up and down and more up etc.

View 1 Replies

ActionScript 2.0 :: Code In Flash To Read It Line By Line But Its Only Showing The First Line Out Of 5 Lines?

Dec 17, 2009

i have an xml file and i want my code in flash to read it line by line but its only showing the first line out of 5 lines.Below is the code:

var NigeriaNumber:Number;
var stateName:String;
var year:String;

[code].....

View 0 Replies

Flash :: Maintain A LineTo Between Two Points In AS3?

May 5, 2011

I'm looking to work out the most efficient way to maintain the joining of two points with a line in AS3. Basically, I have a whole bunch of circles that move around, and have a property subNode which will act as an end point for the line. At the moment, the way I'm doing it is extremely intensive:

[Code]...

View 1 Replies

ActionScript 2.0 :: Making Ball Follow A Line?

Jan 14, 2003

I 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.

View 2 Replies

ActionScript 3.0 :: Making A MovieClip Follow A Line (shape)?

Oct 23, 2009

I 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]......

View 3 Replies

ActionScript 2.0 :: Making Movie Clips Follow A Custom Line But They Movie With The Cursor

Feb 4, 2009

trying to make a movie clip follow a custom drawn vertical line, the movie clip follows the cursor but only the y axis

I have added an example of what i mean and the file i need it to happen to

ps the vertical line needs to be hidden.

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

Flash - When Drawing A Freehand Line With The Cursor, How To Make It A Dashed Line

Nov 23, 2011

I am using Flex 4 and AS3 and I am trying to make it so that the user can draw a freehand line with the cursor - I have this part done.However, I also need the line to be a dashed line instead of one solid line like it is now. below is my code I am using. I have found some examples on how to do this, but they are all for straight lines, not for a freehand line.

Class File (DrawingArea):

package
{
import flash.display.BitmapData;
import flash.events.Event;
import flash.events.MouseEvent;

[code]....

View 3 Replies

ActionScript 2.0 :: Draw Line Like Flash Line Tool?

Mar 12, 2010

I 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 Replies

ActionScript 2.0 :: Funny LineTo Bug?

Feb 19, 2007

Download the attached file and test it. Wait a few seconds, maybe 10-20 sec, and then se the a bug appear. It looks nice, but why? I was just playing around with lineTo and then i saw this... What do you think ?

View 5 Replies

ActionScript 3.0 :: Repeated LineTo Slows Down

Sep 19, 2009

I am making a demo where an object is moved around the screen with a line tracing its movement. The speed of this noticeably slows down over time. I tried it both with an enterFrame and by setting an interval. I imagine it has something to do with the graphics class vector drawing and garbage collection. Here is a simplified version for demo/testing. If you run it you will see the line drawing slow down over time. Is there a way to achieve it without the slow down?

I read somewhere of a technique where you use the bitmap data class to draw on a stage-sized bitmap.(I've never programmed the bitmap data class before).

Here is the code:

code: var lineX:Number = 100; var lineY:Number = 100;
var deltaX:Number = 10; var deltaY:Number = 10;
var lineDrawing:MovieClip = new MovieClip();
this.addChild(lineDrawing);

[Code].....

View 4 Replies

ActionScript 3.0 :: MoveTo / LineTo And BeginFill

Dec 2, 2009

I'm making a shape (christmas tree) which i can't make with rectangles and circles exc, so i made it with moveTo/lineTo, the problem now is that i can't "call" for it to fill the area inside the shape... how would you do it? Also, i hope i did this the wrong way, because its a really tiresome way of making it. What I've got so far is:[code]

View 3 Replies

ActionScript 3.0 :: LineTo Drawing Circles?

Jan 31, 2010

I have been working on a drawing "game" in my spare time (which is limited). This is probably a common question, if so I appologize. By the way, I do not have the code here, it is on my other computer. Anyway, I was using the lineTo method and a timer listener to fire the addition of each new line segment, if that makes sense. The problem is that when you try to draw an arc quickly, it looks terrible. It draws straight lines. I tried adjusting the timer, which helps a bit but still not great. I looked at the curveTo but could not figure out a logical way to get the achor coordinates. I did some research online and found some that use addChild with bitmaps. I would rather use lines. Has anyone tackled this before?

View 3 Replies

ActionScript 3.0 :: Apply Graphics Using LineTo?

Apr 22, 2010

here I added some source code, but it is not loading the imge

ActionScript Code:
//
graphics.beginBitmapFill(image);
graphics.moveTo(100, 100);
graphics.lineTo(120, 50);

[Code]....

View 4 Replies

ActionScript 2.0 :: Lineto & Setmask Don't Work

Jun 17, 2010

I've got a movieclip of a rectangle in my library which I place on stage to attachMovie. Then I create an empty movieclip which I want to use as a mask on that rectangle clip through setMask. Users kan draw into that empty movieclip. My intention is that only those areas of the rectangle clip become visible where the user is drawing a line. So I used this:

[Code]....

View 4 Replies

ActionScript 3.0 :: Sound And LineTo Synchronization?

Oct 30, 2010

I would like to draw a shape with LineTo (following a motion guide) and having this drawing synchronize to the duration of a sound : if the sound lasts 2 minuts, the drawing should take 2 minuts to be drawn.

View 0 Replies

ActionScript 2.0 :: Drawing Api... AttachMovie Along A Lineto?

Sep 14, 2008

Is it possible to get the values along a lineTo and have movieclips attach along the path?

View 1 Replies

ActionScript 3.0 :: How To Apply Graphics Using LineTo

Apr 22, 2010

here I added some source code,  but it is not loading the imge

graphics.beginBitmapFill(image);
graphics.moveTo(100, 100);  graphics.lineTo(120, 50);  graphics.lineTo(200, 50); graphics.lineTo(220, 100); 

[code]....

View 2 Replies

ActionScript 3.0 :: Add A Sound To The LineTo() Method

Aug 10, 2010

I am trying to add a sound to the LineTo() method. Inside a function I draw the Line and immediately call the Sound file. Here is the code, Is this right ? (jus giving the function here )

function leaderRT(e:MouseEvent){
if(flag) {
graphics.lineStyle(1, 0xCC00FF);
graphics.lineTo(e.localX,e.localY);

[code]....

I want the sound to be played until the line is drawn. Wat modification has to be done ? Also when I execute the above file I get the Stream error ?

View 4 Replies

ActionScript 2.0 :: Using Whatever LineTo(); Draws As A Mask?

Apr 30, 2005

The effect I would like to create is as follows: I have an image movieclip named "myImage_mc", and I want to create a spray paint effect, where the user "paints" whatever myImage_mc is using the lineTo and lineStyle commands. I have the lineTo stuff all done, the problem i have is trying to make whatever the user draws a mask that shows the image.Here's my code so far:

Code:
this.onLoad = function() {
_root.createEmptyMovieClip("empty_mc", this);

[code].....

View 1 Replies







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