Drawing with action script

hi there…

i thought that maybe you guys would know of a good resource to look at to begin to understand how to use action script to draw lines and shapes.

I have some squiggles and shapes here that i have drawn,. and eventually i would like to get the point to where i can watch them being drawn in actionscript.

Looking for books,… or the proper terminology. I searched Kirupa for this,. and didnt come up with what i needed. figured i was using the wrong words?
?? “Drawing with action script” ??

I am sure it is not an easy thing, but i would like to start learning.
thank you.

-me :tb:

hey there, thank you for your reply.

I took a good look at what you sent me, and i dont think that is what i was imagining. hmmmm I am looking for an easier way to make specific lines draw. Currently i have a whole bunch of shapes moving and tweening under a mask of the line to create the effect. I have illustrated a bit of that effect here on this test file. If you dont mind, take a quick look. and imagine having to have like 10 or more of these things going at the same time! It eats up the processor. :slight_smile:
let me know what you think,… or if i am going in the wrong direction.

-me :tb:

i wasnt sure if i was clear on the last post… . i just wanted to clarify:

I am looking for a great way to draw a complex line. Specifically, i am making a large map. and I need to show this line being drawn before you, meeting up with key elements along the way.

take a look at the file if you get a second. :slight_smile: thank you!


something like this?
(check out the heart drawing link in the usage pane)

I did something like this a while ago. I’ll find it and post it here. It used XML to redraw stuff.

EDIT: …unless you will use Senocular’s stuff.

Hmm… Well, here it is… It’s not commented at all, but I could comment it for you if you want to use it.
Just make a drawing and see how Flash redraws it exactly from an array with values. Then press the down-key and see how flash redraws it from the xml that’s created from the array.
You could extract the xml-redrawing function and insert it into your file.
But I think I need to comment it unless you understand code easily.

Oh, one more thing - you’ll have to draw everything you want to draw in one stroke, so you cant draw and release the mouse button and then draw some more, that won’t work. It can be done but then the code must be tweaked and stuff… Which it might need anyway :stuck_out_tongue:

So if you wanna use it, just say so, and I’ll help you with it :wink:

(maybe sen’s thing is better :wink: but this allows you to draw a very complex line :wink: )

I dont know ScriptFlipper… i dont know. I was hoping for something more like what i had posted in the file. I want to see this line drawn, not draw it myself. I have this large map that has a whole bunch of battle campaigns happening at the came time… and i want to show i guess, progress along a path, like a progress bar,. but because of the nature of the lines, it makes it hard to do.
if you get a second, check out the file,. or go here to see the actual map i am dealing with.


thank you :tb: - me

Maybe I didn’t explain it as good as I should have…
First you draw the line. Then press down key. Now it traces your xml data. This xml data can then be used to draw that exact line whenever you want (with a few tweaks ofcourse)
So, say that you want to show someone the way to your house. just put the map there, and draw the line on top of it. then you get the xml and you can load that externally at any time you want, in a completely different file, and it will draw your line justas you did. That’s how it works :beam:

oooooh. i dont know that that will work for me. Good idea though.
I need this line to be an exact mirror of an actual network of rivers and valleys that i drew in Illustrator. There are way too many thing that rely on this line being exactly how it is,…

however,. i do like your method. i am sure that will come in handy down the road.

not to pressure you… but did you see the link to that part i am working on?

-me :tb:

oh yeah I saw it
hmm maybe your original method is easiest then :stuck_out_tongue:

thank you for your help!

i will keep looking,. and let you know if i come up with something better than what i have.

-me :tb:

hmmm, an idea…

I’m not familiar with Illustrator, if the images can be exported with everything transparent but the lines, and the lines can trigger a hittest (by converting them to buttons), I may have a solution for you.

It involves creating a swf to plot the lines via hittest, then exporting that data to a txt file that you can cc&p back into actionscript that will draw the lines from the data. I’ve been wanting to write a script for this purpose, so If the images can be made to behave as mentioned in the above paragraph, it’s a good opportunity to get the job done. :slight_smile: