AS3 Drawing an animation chart real time

Hello

–AS3 programming Beginner–

I’m trying to make a chart in AS3 like trading chart.
It should be a pattern that known before so I could know always what is the X axis and Y axis.
All I succeeded is to draw a line but I want it to be more interesting like zigzag or something like that go up and down…
finally it needs to be stopped and the player should guess if it will go down or up.
that is the whole purpose of the game.

Hope U understand what I mean…
here is the code i did so far:


const myLine:Shape = new Shape();
myLine.graphics.lineStyle(2, 0x5D19C69);

var theX = 181;
var theY = 240;
var NextPosX;
var NextPosY;
var cycles = 200;
var i = 0;

myLine.graphics.moveTo(theX, theY);

var myTimer:Timer = new Timer(1, cycles);

myTimer.addEventListener(TimerEvent.TIMER, stretchLine); myTimer.start();

function stretchLine(e:TimerEvent):void
{
    i = i + 1;
    if((cycles-1) < i)
    {
        trace("Timer stopped at " + cycles + "th cycle.");
        myTimer.stop();
    }
        myLine.graphics.lineTo(theX + i, theY - 15);
        addChild(myLine);
        Yaxis.text = theY;
        Xaxis.text = theX;
    }

Thanks
Tom