# Drawing with actionscript lagggg

**URL:** https://forum.kirupa.com/t/drawing-with-actionscript-lagggg/221359
**Category:** flash
**Created:** [April 3, 2007, 5:00pm UTC](https://forum.kirupa.com/t/drawing-with-actionscript-lagggg/221359 "2007-04-03T17:00:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dan0](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dan0](https://forum.kirupa.com/u/Dan0)
#### Post date: [April 3, 2007, 5:00pm UTC](https://forum.kirupa.com/t/drawing-with-actionscript-lagggg/221359/1 "2007-04-03T17:00:28Z")

</div>

Hey!  
I have this script that is drawing me some nice curvy thingys around my mouse.

It works great (so far of what I have made) but over a few seconds it gets laggy drawing more than 10 lines at a time.

I only have 4 arrays (current X and Y, previous X and Y properties). Each frame flash shifts my current properties to previous and works out the new current X and Y. Then it draws a line between the two. OK, so it isnt extending any variables or having to do more calculations each new frame.

So why does it lagggg after a few seconds of drawing 10+ lines? The only thing I can put it down to is drawing the new lines over the old lines. But it is only having to draw like 20 lines a frame, it does not have to redraw the old ones. So why is it lagging?! Changing the alpha properties from 10% to 100% makes no difference. Please help its really annoying and is stopping my progress.

Would it be better if instead it drew up to say 20 old lines + the new lines each frame then lost any lines older than 20. This would make massive arrays with more than like 10 lines at a time and I guess would never change fps but would like always be laggy.

Thanks for the help,  
Dan
