Create | function
Code:
To create an axis:
Usage: axis (the X coordinate of the origin, the y-coordinate of the origin, the step length, the tick mark length, the x-axis length, the +x axis length, the y-axis length, the +y axis length, the color, the depth)
var my_axis1 = new Axis (this, 160, 108, -150, -100, 0x000000, 1);
var my_axis2 = new Axis (this, 280, 255, 4, -250, -100, 0xff0000, 2);
Here are 4 custom functions:
function Func1 (x) {
return 1/x;
}
function Func2 (x) {
return Math.log (x);
}
function func3 (x) {
return Math.Cos (x);
}
function Func4 (x) {
return x*x-3;
}
Draw function:
Usage: drawfunction (function, line thick, color)
My_axis1.drawfunction (func1, 2, 0xff0000);
My_axis1.drawfunction (FUNC2, 1, 0x003366);
My_axis2.drawfunction (FUNC3, 3, 0X0000FF);
My_axis2.drawfunction (Func4, 4, 0xff6600);
Example:
FLA Source files and related class files package download: Click here to download the source file