PDA

View Full Version : any way to output vector information from drawings on stage?


invader
02-18-2006, 05:54 PM
ok, say you draw something on the stage in flash. i know the information is stored as coordinates and vectors and redrawn much like flash's drawing api can draw with lineTo's and curveTo's. does anyone know of a way to get the coordinate/vector information from something manually drawn?

i've had multiple occasions where i could use this, either with brush drawings or with traced bitmaps. i would like to be able to apply dynamic effects (a.k.a. code effects) to the drawings.

so, can anybody point me in the right direction? is it even possible?

Tink
02-18-2006, 07:02 PM
http://www.peterjoel.com/Samples/ under 'drawing api' click on 'logo freeform', then click on the link in the text 'ASVDrawing.createFreeform' and it should take you to the page with some info and the classes to download.

It may not all be there as it is pretty old!

invader
02-18-2006, 07:03 PM
i've been trying to figure out a way for a little bit now.. i think i might be getting close, but i could still use an easier way.

i noticed that if you export the drawing as an EPS or AI file, the vector graphic will be turned into text. unfortunately, i haven't been able to get a strong pattern out of either one in order to write a script to automate pulling out coordinates. i even tried taking the AI file into illustrator and exporting as an SVG, which (surprisingly) is just a basic XML document containing all the information to draw the shapes. i was able to find some documentation on the SVG format, but it looks like it will take way too much time to try to decypher the coordinates and control points. it looked like it was compressed, because it used some letters and symbols, rather than just integers.

still hoping someone can help me out. there's gotta be an easier way. if i can get something set up to painlessly convert a vector graphic into an array that can be parsed with ActionScript, i'll let everyone know ;)

invader
02-18-2006, 07:06 PM
http://www.peterjoel.com/Samples/ under 'drawing api' click on 'logo freeform', then click on the link in the text 'ASVDrawing.createFreeform' and it should take you to the page with some info and the classes to download.

It may not all be there as it is pretty old!
hmm.. i've seen that site before!

anyway, i downloaded the FLA and took a look at it. it's a cool effect, but it won't accomplish what i need. he has a layer in flash than contain all of the coordinates that get fed into the animation function. that's going to be the easy part for me, and i've written a few things in the past that use data in the same way (but not with that exact effect)

i need some way to produce those coordinates from a flash vector drawing. thanks for your help, though. greatly appreciated

Tink
02-18-2006, 07:47 PM
yep and he produced the co-ord by drawing in Flash, publishing and then he used ASV hence the name ASVDrawing.

Sparkle does a great job of converting vectors to data.