drawing out line that will serve as a mask
im tryin to animate a drawing out of a line, but the line wont be an animation itself, itll be used as a mask that will reveal outline of a rectangle
i’m starting right now and im on this stage so far, the problem is i dont understand why this line is not drawing out horizontally, while it should
variables xpos and ypos are coordinates of the position i want to start drawing it from, xcor and ycor are the cooridnates that will be used to stop drawing once it reaches this point, then jump is how fast i want the line to draw(amount of pixels)
ps:the type is there because i will also make another case for vertical line
i know its not the most efficient way to do this, if anyone has better idea that will make the drawing out nicer and more dynamic i would be grateful. What im tryin to acheive is this simple effect you can see on some of the sites, where durin intro the outline of the rectangle is being drawn out. I cant point to any site at this time though, hope my explanation helps and thanks i advance to all of you that can help me
[left]
lineDraw = function(type, xpos, ypos, xcor, ycor, jump){
this.createEmptyMovieClip("temp", this.getNextHighestDepth());
this.temp.lineStyle(5, 0x003300,100);
if(type=="horizontal"){
temp.onEnterFrame=function(){
temp.moveTo(xpos, ypos);
this.x+=jump;
this.y+=0;
this.lineTo(this.x, this.y);
if(this.x==xpos && this.y==ypos){
delete(temp.onEnterFrame);
}
};
}
};
this.lineDraw("horizontal", 0, 100, 800, 100, 10);
[/left]