954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

AS3 - Graphics.moveTo not working properly

Hi,
I am working on a way to draw a graph with AS3. I have just put my code into different classes. I have a function that draws the graph axis but it doesn't seem to work properly. You will see what I mean in a min.

public function draw_axis():void
{
var container:Sprite  = new Sprite();

container.graphics.lineStyle(1, 0x9C9C9E);
container.graphics.moveTo(paddingLeft-1, paddingBottom); // This is the problem
container.graphics.lineTo(paddingLeft-1, graphHeight);
container.graphics.lineTo(graphWidth-paddingRight, graphHeight);

addChild(container);
}


From what I can work out, thegraphics.moveTo() function only 'Moves' to paddingLeft-1 and not paddingBottom.

Example 2:

container.graphics.moveTo(50, 50);

This does the same thing. It acts likemoveTo(50, 0) and not moveTo(50, 50)

I hope you understand. Please help!

Kieran :(

Kieran Y5
Junior Poster
137 posts since Aug 2010
Reputation Points: 18
Solved Threads: 18
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: