Calling all Ming-a-teers...

Ben Schwarz <[email protected]> Wed, 22 Oct 2003 02:21:02 +1000
Newsgroups gmane.comp.web.ming.general
Message-ID <5.1.0.14.2.20031022021555.00b17f60@localhost>
Hey folks,

I'm having trouble getting my head around this stuff, so I'll fork it to 
you guys and see if you have any ideas.
I want to achieve the following:

Create a file using the script (shown below)
Put another *.swf in the background.
Place the dots created in the script shown below OVER the other swf file...

SCRIPT:

--
<?
	session_start();
	$data = $_POST['draw_data'];
	$desc = $_POST['description'];
	$title = $_POST['title'];
	$price = "45.00";
	$date = gmdate("j/m/y");
	
	if(isset($_SESSION['user'])){
		$user = $_SESSION['user'];
	}else{
		$user = $_POST['usename'];
	}
	
	//draw square

	$movie = new SWFMovie();
	$movie->setDimension(450,360);
	$movie->setRate(30);
				
	// create a black shape, our base shape
	$shape =  new SWFShape();
	$shape->setRightFill(0,0,0);
	$shape->drawLine(5,0);
	$shape->drawLine(0,5);
	$shape->drawLine(-5,0);
	$shape->drawLineTo(0,0);
	
	$date_file = str_replace("/", "_", $date);
	$username_file = str_replace(" ", "_", $user);
	$title_file = str_replace(" ", "_", $title);
	$filename = "drawings/" . $username_file . "_" . $title_file . "_" . 
$date_file . ".swf";

	include("include.php");

	$query = "INSERT INTO catalogue (filename, username, description, price, 
date, title) VALUES('$filename', '$user', '$desc', '$price', '$date', 
'$title');";
	$result = MYSQL_QUERY($query, $conn);
	if(!$result){
		die(MYSQL_ERROR());
	}
	
	//loop data, split into variables
	$data_array = explode(";",$data);
	foreach($data_array as $newVal){
		list($x,$y,$r,$g,$b)=split(",", $newVal);
	        $object = $movie->add($shape);
	        $object->addColor($r,$g,$b);
			//$object->scale($size);
	       	$object->moveTo($x,$y);
	}
	// finishing our only frame in this swfmovie.
	$movie->nextFrame;
	$movie->save($filename);
	
	//tell flash its done
	print("status=complete");

?>
--


If you have any ideas, please do email me, its late and I'm braindead, 
hopefully some stuff will make sense in the morning,
thank you very much for reading!

Cheers,


__ben