Ok, first of all, take a look at this .swf and the part of the code that draws the lines.
This isn’t the actual code, but this is just basically what I’m doing.
onEnterFrame = function() {
for (i=0; i<myArray.length; i++) {
curNode = eval ("node" + i);
this.lineStyle(sLiWeight, sLiColour, sLiAlpha);
this.moveTo(curSubNode._x, curSubNode._y);
this.curveTo(someRandomePoint_x, someRandomePoint_x, curNode._x, curNode._y);
}
}
In the ACTUAL code, on every frame it uses a nested for() loop to target each “dot” on the screen, and then draws a line between it and it’s neighbors.
But it’s just a lot of code to run EVERY frame. I may have to just nix the lines alltogether or something, but that would be very last resort.
This will likely work well on most of your computers.
But, if you have a machine thats a few years old, with a really slow processor , or if you have a Mac :D, test it out on that, then you’ll see that this gets pretty laggy. I’m doing this for work, it’s going to be the basis for our corporate portfolio CD, so it has to run well on most machines. I tested it on our ‘worst-case scenario’ machine here in the office. As well as my PowerBook G4, and the performance is just unacceptible.
So the question is… Has anyone else had to find a more efficient way of drawing lots of lines over and over like this? If so, did you have any success with it? If so would you be willing to share it with me?
Thanks in advance! K