<?php

$movie = new SWFMovie();
$movie->setDimension(400,400);

$movie->setBackground(160, 160, 160);

// main grid
$gauge = new SWFShape();
$gauge->setLine(1, 0, 0, 0);
$gauge->movePenTo(0, 0);
$gauge->drawLineTo(0, 100);
$gauge->drawLineTo(100, 100);
$gauge->drawLineTo(100, 0);
$gauge->drawLineTo(0, 0);


// horizontal 10% steps
for ($i = 10; $i < 100; $i += 10) {
	if ($i == 50) {
		$gauge->setLine(1, 0, 0, 0);
	} else {
		$gauge->setLine(0.5, 0, 0, 0);
	}
	$gauge->movePenTo(0, $i);
	$gauge->drawLineTo(100, $i);
}

// vertical 5 pt on curve
for ($i = 0; $i < 100; $i += 25) {
	$gauge->movePenTo($i , 0);
	$gauge->drawLineTo($i, 100);
}

// the pitch indicator

$indicator = new SWFShape();
$indicator->setLine(1, 255, 0, 0);
$indicator->drawLineTo(0, 100);
//$indicator->setName('test');

$pitch_gauge = $movie->add($gauge);
$pitch_indicator = $movie->add($indicator);
$pitch_indicator->setName('tes2t');

$slider_controll = new SWFSprite();
$shape = new SWFShape();
$shape->setLine(4,25,0,0,128);
$shape->movePenTo(0, 0);
$shape->drawLineTo(10, 0);
$slider_controll->add($shape);
$slider_controll->nextFrame();

$slider = $movie->add($slider_controll);
$slider->moveTo(0, 200);

$slider->addAction(new SWFAction("test._x = 10;"), SWFACTION_ENTERFRAME);

$a = new SWFAction("startDrag(this, 0, 150, 0, 200, 50); drag = true;");
$slider->addAction($a, SWFACTION_MOUSEDOWN);

$a = new SWFAction("stopDrag(); test._x = 10; drag=flase;");
$slider->addAction($a, SWFACTION_MOUSEUP);



header('Content-type: application/x-shockwave-flash');

$movie->output();
// $movie->save("seek.swf");

?>
