Well, this one wasn’t as bad as I thought it might be. The image I chose to vectorize was a lot simpler this time, but it worked really well for the idea I had to script it. Almost the entire key was drawn with the regular flash tools, and I used way to many layers again.. (17 including layers that only served as guides and are hidden). Makes it easier to go back and re-tweak certain things I guess. So the notches are the only part of the key that’s drawn with the script. I have a line drawn for the outline, and the last 2 line segments (which close the shape) are drawn the same color as the fill to make them invisible. There’s 23 points on the line, and a total of 9 variables to control their position (a few never move).
You can view the .swf or download the source.
edit: I was going to modify the source to smooth the transitions between each set of notches, but then I realized that the lineto() function only allows integer values..so that made it kind of pointless to pursue (not much you can do to smooth a change of 2 pixels if you can move a minimum of 1 pixel at a time). It’s kind of annoying how many of flash’s built-in functions will only accept integers, but it has no problem placing your points/objects at decimal values when you modify things on the canvas.




