ActionScript 2.0 :: Speeding Up The Drawing Methods - Render More Than 50 Lines At A Time
Jun 1, 2003
i'm working on a drawing tool with the flash drawing methods, but my movie starts to slow down. i'm storing the variables in an xml object and then looping through them onEnterFrame. right now i'm limiting the amount of lines that are drawn to 50. anyone have any tips on speeding up the drawing methods. as i understand it they are the same methods that flash uses to draw all it's lines. shouldn't it be able to render more than 50lines at a time.
View 2 Replies
Similar Posts:
Aug 12, 2010
I'm looking to speed up compile time. Back in the day I used MTASC and it would just update the code of the swf.
Since AS3 I need to publish the movie from the IDE and it takes forever because of the images and fonts in the library.
Is there anything that works like MTASC these days? Or does anybody have a real smart work flow I should consider?
View 5 Replies
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
May 17, 2011
I have a huge code execution with many loops and pre-rendering processes and I was wondering if there is a way to tell the flash player to take a little pause on the code side and do a render.
Basically I have my execusion that takes a while, and on each step I make a call to a screen and then modify the scale of a loading bar. Now the problem is that the user only sees the progress at the end, I know this is due to the fact that flash does code execution and then render, i tried to make calls to stage.invalidate to force a render but it wouldnt work until the whole execusion if finished either. Is there a way to force flash to render between two lines of code?
View 3 Replies
Mar 13, 2010
In my Flex application, using a custom control, I am making a JSON request to grab some data from the server. My rendering depends on this data such as knowing how many boxes to draw. How can I either force the rendering to wait until I've got the data before drawing to screen or have the boxes draw once we receive the data? I have an event listener for Event.COMPLETE for my JSON request and in there, I call methods that add to the control. I've tried invalidateDisplayList but that doesn't seem to do anything for me?
View 1 Replies
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
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
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
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
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
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
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
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
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
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
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
Aug 20, 2009
Drawing diagonal lines for a background, any one know how to do it?
View 4 Replies
Apr 20, 2004
I am drawing a set of connected lines in a MC that is created using createEmptyMovieClip. The lines start at (0,0) within the MC and move into the negative x values when the lines move left. The problem I am having is when repositioning the MC. When I tell the MC to move to _x=0 and _y=0, it doesn't move to the stage's (0,0), it still hangs off the left side of the stage. The following image shows the MC positioned to (0,0) (note: the green is the stage):shouldn't the MC containing the drawn lines use its left-most point when being repositioned so that it doesn't hang off the left side of the stage?
View 5 Replies
Apr 21, 2009
I'm doing this project, about 2 lines intersecting each other(the 2 lines are not always on the same position). I try to find the intersections point using collision detection method but how do I place an object on the intersections point?
if(line1.hitTestObject(line2)) //
So this is how we find the intersection point but we do not know how to draw / place an object on the intersection point.
View 6 Replies
Jun 15, 2010
I'm trying to write something like this facebook app [URL] I've already written code to let user to move circles with mouse, but i've got a problem with lines connecting them- sometimes i see old ones, which should have been deleted already. I refresh all lines every time any circle is moved. Here is my code which draws lines
[Code]....
View 1 Replies
Jul 28, 2011
I'm making an animation wich draws a line after a moving object (circle on a guide line). this circle is a movieclip. and I have many lines to draw up, so i put many of them on separate scenes. I've created buttons from movieclips, and when pressed it draws a line. I got everything to work properly, but when one line is drawn, and you press the same button to get the same line drawn again I get the error code.. #1009 cannot access a property or method of a null object reference.I think that it's because the graphics is still there but i can't seem to clear it before it draws again.. Ive used graphics.clear (); but that just clears all, so when it "draws" again it doesn't show..only the movieclip-animation works. so what is the problem here?my code for the line drawing is:
import flash.display.Shape;
import flash.events.Event;
var shape = new Shape();
[code]....
View 1 Replies
Mar 3, 2012
I have a candleStickChart in flex 4.5 with a dateTimeAxis horizontal axis.I wish to have a button that enables to draw a line on top of that chart.I wrote a code that each time the button is click, a new CartesianDataCanvas is created. than I do a pretty standard line drawing by listening for the MOUSE_DOWN, MOUSE_MOVE, and MOUSE_UP to draw the line.In the MOUSE_DOWN event I create the new CartesianDataCanvas, and update the annotaionArray as described in the following code: (candles is the candleStickChart's id)
public function startDrawing(event:MouseEvent):void
{
canvas = new CartesianDataCanvas;
[code].....
View 1 Replies
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
Oct 6, 2009
I want to draw a curved line between random point. How can I do this? The random points are actually x,y positions of movie clips dragged on the stage and I want to code curved lines between them.
Im looking at curveto in as2 but not sure how to to do it?
View 0 Replies
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
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
Nov 30, 2007
I am drawing some circles with a bit of code like this:
Code:
for (var i = 0; i<=1; i++){
for(var j = 0; j<= 1; j++){
this.drawMyCircle(radius,i*a,j*b);
}}
//a and b being the gap between the columns and rows
What I would like to do is add some metadata to each point I create, containing the centre coordinates for that dot (e.g. i*q, j*b). I have no idea about this part. Then with an onRelease event on a given dot , I can get the location. I have never dynamically made an event firing object. My goal is to be able to draw lines between two clicked dots. Unfortunately I have to do this dynamically so I can introduce a bit of variety.
View 1 Replies
Mar 25, 2011
I'm trying to draw a line between circles stored in an array. I have a button on the stage which adds another circle to the stage. My issue is I cannot draw a line between the most recent circle added to the array and the one that will be added next.
It is a bit complicated and I'm not an experienced programmer by any stretch of the imagination.
Anyway, here's my code:
[Code]...
View 2 Replies
Nov 19, 2009
I ran into a problem when attempting to draw long line segments - some lines will be poorly scaled and appear very thick. I ran into this issue when building a Google Maps Flex application and thought the problem resided there, but I then tested with a basic Flex application and duplicated the problem.
Here it is:
Code:
var _lineSprite:Sprite = new Sprite();
Application.application.rawChildren.addChild(_lineSprite);
_lineSprite.graphics.lineStyle(
6, // thickness
0xFF0000, //color
1.0, //opacity
true, //pixel hinting
LineScaleMode.NONE);
_lineSprite.graphics.moveTo(-70000,-20000);
_lineSprite.graphics.lineTo(400, 400);
The code above will draw a line segment that is much thicker than the desired 6 pixels. The problem can be seen here: [URL]. Once the page loads, click the "Show Custom Polyline" button, then the "Zoom to Problem Coordinates" button and you should see two line segments - one very thick and one thin. They should both be the same width as the thin line. Strangely, in the code sample I posted above, if the starting coordinates for the line are changed from -70000, -20000 to -70000, 20000 or to -140000, -40000 the line draws correctly. I'm using Flash Player 10.
View 0 Replies
Mar 5, 2005
Currently I am working on a map that will animate the drawing of a line between two points as soon as the user hovers over the end point. A good example of this can be seen on the home page of Jet2.com (the map of Europe).
It seems I am having difficulty with drawing the line dynamically. Of course, just drawing a still line between two points is easy, just use MoveTo() and LineTo(). However, having the line expand in an animation is quite difficult for me.
Here is what I've come up with so far:
Code:
// Create the clip
this.createEmptyMovieClip("drawing_mc",1);
// Declare variables
[Code].....
View 10 Replies