Skip to main content
Participant
May 5, 2006
Answered

Newbie troubles: please help

hello folks, can you please point me in the right direction:

I have the following actionscript on a single layer, single frame movie; there are no symbols used...I am trying to draw a right angle with an animated line...I want the second line (y-axis) to start to draw after the x-axis is drawn; instead they both begin to draw at the same time...

_root.createEmptyMovieClip("lineTest", 1);

var currentX:Number = 100;
var currentY:Number = 100;

function drawX(){

currentX = 100;
currentY = 100;
drawI = setInterval(drawF, 10);
_root.lineTest.lineStyle(3, 0x43E5E5, 10);
function drawF() {
_root.lineTest.moveTo(currentX, currentY);
currentX += 1;
/* trace(currentX); */
_root.lineTest.lineTo(currentX, currentY);
if (currentX>=300) {
clearInterval(drawI);

};
updateAfterEvent();
}
}
;
function drawY(){

currentX2 = currentX + 200;
currentY2 = currentY;
drawI2 = setInterval(drawF2, 10);
_root.lineTest.lineStyle(3, 0x3F3F3F, 10);
function drawF2() {
_root.lineTest.moveTo(currentX2, currentY2);
currentY2 += 1;
_root.lineTest.lineTo(currentX2, currentY2);
if (currentY2> 300) {
clearInterval(drawI2);

};
updateAfterEvent();
}
}

drawX();
drawY();
stop();
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
May 5, 2006
execute drawY() when currentX>=300.

2 replies

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 5, 2006
execute drawY() when currentX>=300.
Translate
CieltoAuthor
Participant
May 5, 2006
thanks, kglad...of all the things I tried, this one escaped me, yet so simply...so much to learn...thanks again...
Translate