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();
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();
