ActionScript 3.0 :: Drawing - Erases The Square And The Line

Feb 11, 2009

I have a function that draws a square, when that square is clicked on another function draws a line. I want to erase that line when its clicked on a second time. Graphics.clear, erases both the square and the line. Remove child gives me an out of bounds error. Not sure what to do.

[Code]....

View 2 Replies


Similar Posts:


ActionScript 2.0 :: When Creating A Dynamic Square With The Api - Won't Drawing Api Square Object

Dec 2, 2010

when creating a dynamic square with the api. 400 by 400. I am not sure why it wont draw the object

[Code]...

View 2 Replies

ActionScript 2.0 :: Drawing In MX Confined To Shape (not Square)

Jun 7, 2004

I've found a similar thread to this but my problem's a little different.I've never used the drawing function on Flash and I followed the fairly simple tute on it just recently.Is there any way to confine the drawing area to a specific shape. Mine's a rectangluar shape that's rotated. You can download my FLA with the background image here > url...I'd like to try and keep it confined to the notepad area.I think it might be a hitTest thing with if/else. My other thing would be to just rotate the notepad so that it's straight.Even still i'd like it confined to the area beginning with the corner of the notepad, not the corner of my movie.

View 2 Replies

ActionScript 2.0 :: Drawing A Square Without The Fill Only The Lines In Refresh

Aug 29, 2009

I what to make a function that is drawing a square without the fill only the lines in refresh(sometime fast, sometime slow). And I don't have a clue about the starting point of this function.

View 1 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 3 :: Drawing An Arrow At The End Point Of The Line Using Line Slope?

Jan 9, 2012

I am developing a white board application which allows the user to draw line with arrow head (some like Microsoft Word line with arrow feature). I am using graphics property along with lineTo() method to draw a line. Now i have to draw a angular arrow on the last point of line. I am drawing the arrow by connecting the points around last points. As 360 line can pass through this point and each line can have a different angle of arrow.

View 1 Replies

ActionScript 3.0 :: Cant Get Units To Line Up With There Square

Jan 14, 2011

[code]i use that to change it from a flat image to the prespective view, but i cant get the units to line up with there square anymore, i assume its since the Grid is at 200,200 and UnitLayer is by default at 0,0 but changes based on what square is in the middle of the grid (the data loaded from variables the squares in the Grid never changes positions)

View 4 Replies

Flash :: Professional - Draw Anything Like A Square Or A Line It Is Green

Mar 8, 2010

When i try and draw anything like a square or a line it is green. Also when i try and fill naything it doesnt work!!!! It is quite important that i get it fixed because i need to use flash for an assesment that is due in next week!!!

View 1 Replies

Actionscript 3.0 :: Flash Drawing Board With Erase Function / Erase Line By Line

Jan 9, 2009

Im building a pretty simple drawing board in flash, i got this code from this forum and it works fine (there is more to it but this is the drawing part)[code]This works fine. But i want to be able to erase the drawings, step by step this is ths tricky part, ive looked everywhere(ok not everywhere) but in a whole lot of places but the only thing i found is how i could delete everything with removeChild and that in not what i want. Maybe i need to change the function abowe? Please help me to get in the right direction. What should i read about /look at?

View 5 Replies

Dynamic Drawing - Choose And Draw With Other Shapes - Square - Forward Slash (/) - Backward Slash ()

Oct 13, 2009

I am trying to work with this flash tutorial -[URL] So far it draws with a simple rounded line. I have been extending this application by making the drawing board bigger and other small things. I now want to be able to choose the line style. Currently it is rounded and I want to choose and draw with other shapes - square, forward slash (/), backward slash (). Is this possible? If so, could you explain how I could go about it?

View 1 Replies

IDE :: Animating A Drawing Line?

Nov 19, 2009

How do i animate a drawing line? I mean like from point A to point B, the flash will show it is "drawn" itself.Can I do it simply without actionscript? Is it possible? Because I have many lines to draw, to make it into a diamond.

View 14 Replies

ActionScript 3.0 :: Line Drawing Effect?

Apr 16, 2009

What I'd like is the ability to draw a line with the drawing tools in Flash, and have that line appear onscreen as if it were being drawn. I don't think there's a way to do that with the animation tools (I'd like to give it a go, but I have no idea, once I've drawn a line and converted it into a symbol, how I could access the anchor points and whatnot of said line to then do some funky stuff with curveTo, or whatever better solution is out there...

View 2 Replies

Create An Animation Of Line Drawing Itself?

May 15, 2009

How can a create an animation of line drawing itself.

View 1 Replies

Simulate Drawing A Line Or Growth

Nov 9, 2009

With several flashes I'm trying to create, I find that I need to know how to depict a line being drawn or a plant/vine growing (same concept right). Obviously frame-by-frame animation can be used, but that's quite tedious. There must be some other, more productive way to pull it off. Example of the vine: [URL] I've tried shape tweens with shape hints but it didn't render very well at all.

View 6 Replies

ActionScript 3.0 :: Looking For Smooth Line Drawing In It?

Oct 18, 2010

I am looking for a smooth line drawing effect as in the pencil tool in Flash. I need to implement the same using as3.

View 7 Replies

ActionScript 1/2 :: Drawing A Long Line?

Mar 26, 2009

I'm having troubles with the width of a line using the lineTo and lineStyle function, I can put setting the thickness and noScale parameters, and it works fine for no longer lines than 32000 pixels, but when I try longer line, the thickness changes to a bigger width. if you want to try what I'm saying you can prove this by changing the num variable:to 33000 for example:

num = 32000
this.createEmptyMovieClip ("Envolvente", 100);
this.Envolvente.lineStyle(0,0x00CC00,100, false, "none",
"round", "miter", 0.8);

[Code]...

View 2 Replies

ActionScript 3.0 :: Line Drawing Is Too Slow

Sep 4, 2011

i'm developing a game for mobile devices where I need to draw many objects and some lines(1~3 just occasionally).
 
my problem in short is: Line drawing is too slow for iPhone4

objects are drawn with bitmap, so it's pretty fast with GPU support. drawing lines are slow.

a end point of a line follows mouse cursor, so it changes every frame.

here's how i did it

initialization step:
var img:Shape = new Shape();
addChild( img );

[Code]....

that gives me 47~48 FPS on my iPhone. +2 FPS but still way too slow for a simple line. 
 
without the line, i can maintain my whole game around 30 FPS. with the line, it goes below 20.

View 3 Replies

Flex :: Drawing Line Without Mxml ?

Feb 16, 2011

i want to draw a line with actionscript .Here is my code

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]......

View 2 Replies

ActionScript 2.0 :: Animating A Line Drawing?

Sep 23, 2009

I was told that by using actionscript to animate, it will make the flash file smaller and animations smoother... is this a correct assumption?

with this in mind, I have the code:

ActionScript Code:
this.createEmptyMovieClip("myLine", 10);
myLine.lineStyle(2, 0x000000, 100);
myLine.moveTo(10, 10);

[Code].....

View 0 Replies

ActionScript 3.0 :: Drawing Slope Of A Line?

Jan 27, 2011

I'm trying to create a simple graph showing the stock trends for the past few days. In the x axis I have the dates and in the y axis I have the stock value. I have to do this dynamically and I think I can figure it out, but I need help with something else: I need to be able to (dynamically) draw the slope of the line as the user clicks on a point... something like in www_calculusapplets_com/twicediff.html except that instead of having the slider the user will click on the actual line.

View 6 Replies

ActionScript 3.0 :: Drawing Line Between Two Movieclips?

Feb 28, 2011

I am having some trouble drawing a line between two movieclips. One of the movieclips is moved with the arrow keys. The line is created between them, but every time the movieclip moved another line is created. I would like only one line to connect the two movieclips. I am trying to create some sort of "AI." When the line hits a wall, then there isn't a clear line of sight. Here is the code:

ActionScript Code:
stage.addEventListener(Event.ENTER_FRAME, moveguard);
function moveguard(event)

[code].....

View 9 Replies

ActionScript 2.0 :: Drawing A Line Over 12 Frames?

Apr 9, 2006

I was looking for tutorials on drawing in flash using actionscript and all of the tutorials I found showed how to create content instantly (with the click of a button etc).But I was wondering if it was possible to use actionscript to draw a line from coordinate A to B over, say 12 frames?

View 9 Replies

ActionScript 2.0 :: Drawing A Line 'progressively' Using The API

Apr 18, 2007

Drawing a simple line is easy - here's some sample code here from Kirupa:

[Code]....

My First Question is - how can you get it to show the drawing of the line - almost like an animation? This example instantly shows the line - I want the appearance that you're watching the line being drawn. Do you animate the lineTo variable and just keep refreshing? My Second Question is - can you do the same with a Bezier curve? In the end, I'm trying to draw random bezier lines from the left to the right in varying thicknesses and shapes (being able to see them being drawn from left to right).

View 8 Replies

ActionScript 2.0 :: Dynamic Line Drawing?

Dec 17, 2007

I have a line drawing that I have to animate it has curved lines like the image attached.I have tried tweening however it looks terrible and not smooth in it drawing.this is the action script I already have so far.

createEmptyMovieClip ("curveLine", 1);
with (curveLine) {
lineStyle (2,0xffffff, 600);[code].....

View 3 Replies

ActionScript 3.0 :: Line Tool (for Drawing App)?

Jan 26, 2009

right now i can create a straight line from mouse down to mouse up. what i cant quite get is a preview of that line. does anyone know of a simple way to show a preview of the line while the mouse is still down and the user is moving the mouse?what i have now:

Code:
var clip:Shape = new Shape();
addChild(clip);[code]......

View 2 Replies

ActionScript 2.0 :: Drawing A Straight Line?

Jan 30, 2009

I've followed the drawing api tutorial off here for MX and have got that working perfectly. I would like to adapt this now if I can so that when a user clicks a straight line will follow their mouse until they click again and this releases the straight line.

View 2 Replies

Create An Animation Of A Line Drawing Itself?

May 15, 2009

How can i create an animation of a line drawing itself.

View 1 Replies

ActionScript 2.0 :: Have An Enemy Square That Chases The Player Square?

Jan 15, 2010

I have this game, and some levels have a moving square as the player, you move the square with your arrow keys.... I want to have an enemy square that chases the player square.... They only chased mario when you didn't look at them? Kinda like that...... but in this regards:

I only want the enemy square to chase the player square when the player square moves.... soo say the player square moves 5 pixels per movement (know how to do all that), I want the enemy square to move when the player square moves..... towards the player square at like 7 pixels per movement..... so eventually you won't be able to avoid the enemy square....

View 4 Replies

ActionScript 3.0 :: Drawing Objects At Vertices Of Line?

May 8, 2009

I'm trying to make a short script in AS3 which will simply take some animated lines that are in a movieclip (pre-animated in library) and draw a 15px diameter circle around each vertex / point of the lines.

how to access the vertices of the lines in actionscript!

View 2 Replies

ActionScript 3.0 :: Drawing Line By Clicking On Stage?

Nov 5, 2010

I started working with AS3 a month ago, I know the basics and stuff, but I can't do that much. The user would draw lines by clicking on the stage. The code works exactly as I wanted it to, but it is on AS2 . I tried, but I can't 'convert' it to AS3. I would like to know how this code would work on AS3! Here's the download link of the .fla, so you can see better what I mean: [URL].

View 3 Replies







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