Lines in MX

Can anyone tell me of direct me to a tutorial on how to draw lines in MX. I want to draw a square or a rectangle. I would prefer to use actionscript, but a tween would be ok. Thanks.

read this tutorial … it should give you something to start :slight_smile:
http://www.kirupa.com/developer/actionscript/tricks/drawing_api.asp

drawing api isn’t bad…but it doesn’t give you the “invisible hand” effect that most people are looking for.

When i want lines to be drawn i just use masks.

on one layer, make the line as you want it to be seen completed in your movie. Then make a new layer right above it and draw a rectangle big enough to cover the line. Make the rectangle a movie clip. If you want your line to be drawn from left to right, in the first frame of your rectangle layer, put the rectangle to the left of your line. Then make a keyframe, let’s say… about 10 frames later… on that keyframe have the rectangle completely covering the line. Put a motion tween on your rectangle layer, then right click your layer with the rectangle, and make it a mask layer.

Takes a little bit of time, but not too bad… and you can make any shape you want by just doing this for every line in the shape.

yep … masks would be my second option as well …

but it’s more fun using drawing api =)

yeh but how do you get the drawing API to make it look like it’s being drawn by an invisible hand??? Everytime i’ve done it it’s just popped up all at once…

Just split your rectangle in a lot of points, and then draw :slight_smile:

i use shape tweens on lines its really great since the filse size stays small, just make a square and select each line and paste each line on its own layer do a shape tween from where you want the line to start to where it should end at the first frame of each line just make an alpha on each lines beggining point so they look like theyre being created on their own try it out

Grim