Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Need Help Generating Flash Movie With Ming Library, Please?
timstokman
post Feb 11 2005, 06:41 PM
Post #1


Member [Level 2]
*****

Group: Members
Posts: 86
Joined: 19-October 04
From: Alkmaar, the netherlands
Member No.: 1,832



I am doing a school project and the guy I am doing it with want some animations. Since gif animations are not supported by php (patent trouble) I had to make a flash movie. I allready have the basic code and stuff but the images I try to import in my flash movie don't show. I am trying to use a gameboard as background for the movie. After the TODO comment I am going to edit the image so I get an animation, but first things first so this is my code:

CODE

<?php
//invoer:
//array met posities van de huizen $huis
//array met posities van de hotels $hotel
//array met posities van de spelers $speler
//begin en eindpositie van de bewegende pionen $begin en $eind
//mp3 om te spelen $mp3

//nieuwe sprite (bewegend plaatje)
$sprite = new swfSprite();

//loop door de frames
for($x = $begin; $x <= $eind; $x++)
{
//laad plaatje
$image = imageCreateFromJpeg('images/monopoly.jpg');

//TODO: tekenen huizen, pionnen, animatie etc.

//voer image stream uit en buffer het
ob_Start();
imageJpeg($image);
$buffer = ob_Get_Contents();
ob_End_Clean();

//voeg image toe aan shape
$frame = new swfShape();
$bmp = new swfBitmap($buffer);
$frame->addFill($bmp);

//voeg het frame toe aan het filmpje en ga naar het volgende frame
$sprite->add($frame);
$sprite->nextFrame();
}

//voeg de sprite toe aan een filmpje
$movie = new swfMovie();
$movie->add($sprite);

//bewerkt filmpje voor uitvoer
$movie->setBackground(255, 255, 255);
$movie->setDimension($bmp->getWidth(), $bmp->getHeigth());
if(isset($mp3))
{
$movie->streamMp3(file_get_contents($mp3));
}

//voer flash uit
header('Content-type: application/x-shockwave-flash');
$movie->output();
?>


Sorry for the comments, don't have time to translate them. Can anyone tell me how to get this working? I get a flash movie outputted but it's blank. Thanx in advance.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Mambo Migrating(1)
  2. Php And Flash Movie Ie Problem(2)
  3. Simple Chat(8)
  4. Flash Portal Script(3)
  5. Requesting Auto Generating Id Tag In Php Code(2)
  6. Flipping An Animated Gif Image W/ Gd Library(1)
  7. Flash + PHP: How can I transfer vars?(4)
  8. Php And Flash Image Gallery(5)
  9. Get A Image Indentifier With Gd Library(7)
  10. Flash With Php(1)
  11. Library Script(6)
  12. Flash And Php(5)


 



- Lo-Fi Version Time is now: 22nd November 2008 - 05:30 PM