I have now been asked by a client to draw a wavy line with the cursor/mouse such as the following:

(source: endeavoursportsgroup.com)
I have the following code below which draws a line with the cursor/mouse, but I am stuck on how to make the line “wavy”. This is actually modified code from drawing a dashed line I was working on earlier, so there may be some left over code from that which I will remove later.
Can someone help me achieve the Wavy Line that I have been asked to create with my code below or suggest another way to achieve this?
Thanks in advance!
package
{
import flash.display.BitmapData;
import flash.display.Graphics;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.net.FileReference;
import flash.utils.ByteArray;
import mx.core.UIComponent;
import mx.events.FlexEvent;
import mx.graphics.codec.PNGEncoder;
public class DrawingArea extends UIComponent
{
private var isDrawing:Boolean = false;
private var x1:int;
private var y1:int;
private var x2:int;
private var y2:int;
private var LastX:int = 0;
private var LastY:int = 0;
public var drawColor:uint = 0x0000FF;
public function DrawingArea()
{
super();
var p1:Point = new Point();
var p2:Point = new Point();
p1.x = 0;
p1.y = 0;
p2.x = 200;
p2.y = 200;
addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void {
graphics.clear();
graphics.beginFill(0xffffff, 0.00001);
graphics.drawRect(0, 0, width, height);
graphics.endFill();
});
addEventListener( MouseEvent.MOUSE_DOWN, mouseDown );
addEventListener( MouseEvent.MOUSE_MOVE, mouseMove );
addEventListener( MouseEvent.MOUSE_UP, mouseUp);
}
private function mouseDown(event:MouseEvent):void {
x1 = mouseX;
y1 = mouseY;
isDrawing = true;
}
private function mouseMove(event:MouseEvent):void {
if (!event.buttonDown)
{
isDrawing = false;
}
x2 = mouseX;
y2 = mouseY;
if (isDrawing )
{
var p1:Point = new Point();
var p2:Point = new Point();
p1.x = x1;
p1.y = y1;
p2.x = x2;
p2.y = y2;
graphics.lineStyle(2,0x00FF00,2);
graphics.lineStyle(1, drawColor);
graphics.moveTo(x1, y1);
graphics.lineTo(x2, y2);
x1 = x2;
y1 = y2;
LastX = x2;
LastY = y2;
}
}
private function mouseUp(event:MouseEvent):void {
isDrawing = false;
}
}
}
Please try the following code. It is not ideal, but it can probably give you some idea.