Groups | Blog | Home
all groups > flash actionscript > june 2005 >

flash actionscript : lineTo HELP! animating a square



jevans27
6/24/2005 9:17:15 PM
I am trying to use the lineTo method to draw a square. I have the code correct
to draw a line or make a square appear but I can't put them together to create
square that looks like it's being drawn. If anyone could help me I would
appreciate it. Here are two samples......

I just want to basically get to where I have a border draw in using
actionscript. Thanks Jason

Code to draw just a basice Line:

_root.createEmptyMovieClip("lineTest", 1);
currentX = 100;
drawI = setInterval(drawF, 5dra);
_root.lineTest.lineStyle(3, 0x00990, 100);
function drawF() {
_root.lineTest.moveTo(currentX, 100);
currentX += 5;
_root.lineTest.lineTo(currentX, 100);
if (currentX>=400) {
clearInterval(drawI);
}
updateAfterEvent();
}



Code to create a square:

_root.createEmptyMovieClip("square_mc", 5);
square_mc._x = 13;
square_mc._y = 100;
//
square_mc.lineStyle(1, 0x000000, 100);
square_mc.beginFill(0xFFFFFF,100);
square_mc.moveTo(0, 0);
square_mc.lineTo(100, 0);
square_mc.lineTo(100, 100);
square_mc.lineTo(0, 100);
square_mc.lineTo(0, 0);
square_mc.endFill();


Chip W.
6/24/2005 10:06:12 PM
hey J,

Check this guy out, he's a genious:

www.senocular.com

Under Flash, click on Source files, and search for "Tween" or "Draw". that will definitely get ya started.

jevans27
6/25/2005 7:58:04 PM
hey chipley.........thank you so much......i have been to his site before. i didn't even think to search for tween or draw. He's a genious alright. man.....

thanks for your help.
AddThis Social Bookmark Button