Problems with slideshow-script
Ruprecht Helms <[email protected]> Tue, 2 Dec 2003 20:39:24 +0100
| Newsgroups | gmane.comp.web.ming.general |
|---|---|
| Organization | Ruprecht Helms |
| Message-ID | <[email protected]> |
Hi, I'm using ming-0.3a in the moduleversion. Actualy I'm trying to produce a little slideshow with the scriptexample of gaz. My Problem is that not slideshow.swf was created after running the script, but no error was shown. How is the problem - The files I want to build into the slideshow I've stored in the directory with the php-script. Attached the script. Regards, Ruprecht _______________________________________________ ming-fun mailing list [email protected] http://www.opaque.net/mailman/listinfo/ming-fun
slideshow.php
(text/x-c++src, 977 B)
// grab jpgs from current dir and create a swf slideshow...
<?
dl("php_ming.so");
// some typical movie variables
Ming_setScale(20.00000000);
//ming_useswfversion(6);
$movie=new SWFMovie();
$movie->setDimension(550,400);
$movie->setBackground(0xcc,0xcc,0xcc);
$movie->setRate(12);
// scan $dirPath for files with $ext and return $fileNameArray
function getFiles($dirPath,$ext){
$fileNameArray = array();
if ($handle = opendir($dirPath)) {
while (false !== ($file = readdir($handle))) {
$tmp = explode(".", $file);
if($tmp[1]==$ext){
array_push ($fileNameArray, $file);
}}}
closedir($handle);
return $fileNameArray;
}
// get array of jpgs in current dir
$jpgArray = getFiles(".","jpg");
// add the jpgs to the movie
for($i=0;$i<count($jpgArray);$i++){
$img = new SWFBitmap(fopen($jpgArray[$i],"rb"));
$pic=$movie->add($img);
$pic->moveTo(100,100);
for($j=0;$j<5;$j++){
$movie->nextFrame();
}
$pic->moveTo(-500,-500);
}
// save the movie
$movie->save("slideshow.swf");
?>