PDA

View Full Version : Animate shape



honey4d
July 5th, 2003, 05:47 PM
Hello

I found the following code within a tutorial on the Kirupa website showing how to draw a square using ActionScript but I was wondering if it would be possible to modify this so that each line is animated in turn to construct a square (similar to the mouseover effect on the www.fontsforflash.com website (right column 'Showcase' graphic)):

_root.createEmptyMovieClip("holder",1);
holder.lineStyle(1,0,100);
// This is half the width of the square
width=30;
// The center of the square is (150,150)
holder.moveTo(150-width,150-width);
holder.lineTo(150+width,150-width);
holder.lineTo(150+width,150+width);
holder.lineTo(150-width,150+width);
holder.lineTo(150-width,150-width);

Any suggestions would be appreciated.

Many thanks.

Jon

adityagaddam
July 5th, 2003, 05:54 PM
hmm.. before I start.. I want to ask you if you "need" to do this with drawing API..

can u just use shape or motion tweening?

-Aditya
just checking cause if you dont need to use Drawing API.. much cleaner faster way would be motion tween

[m]
July 5th, 2003, 07:08 PM
It's much easier if you just use a mask. They probably used it aswell.

adityagaddam
July 5th, 2003, 07:09 PM
ypu.. thanks for reminding me [m].. a mask would be a lot easier.. :P

-Aditya