PHPBuilder - Getting Started with PHP/Ming Page 3



RSS Twitter
Articles Setup And Installation

Getting Started with PHP/Ming - Page 3

by: Iman S. H. Suyoto
|
August 10, 2001

After the adjustments, I could make and make install successfully. As the message make install says, we should not forget to add extension=php_ming.so to php.ini (and something not mentioned, restart our web server). I did those things and I could later use the code shown in the next section.
I don't know whether we should do these tasks under other Debian-based distros like Corel Linux or Storm Linux. I haven't tried (even I have never installed any of them). I would be glad if someone can inform me about it.

Testing the Installation

After we have successfully installed PHP/Ming, we can try this code:

<?php
// create movie and set parameters
$movie=new SWFMovie();
$movie->setBackground(0xee,0xee,0xff);  // nice light blue
$movie->setDimension(800,600);
// draw rectangles
for($c=0;$c<5;$c++)
$shape=new SWFShape();
  
// set line width 20, with blue shade
  
$shape->setLine(20,0x00,0x00,$c*50);
  
$offset=$c*20;
  
$shape->movePenTo(100+$offset,100+$offset);
  
$shape->drawLineTo(700-$offset,100+$offset);
  
$shape->drawLineTo(700-$offset,500-$offset);
  
$shape->drawLineTo(100+$offset,500-$offset);
  
$shape->drawLineTo(100+$offset,100+$offset);
  
// add to canvas
  
$movie->add($shape);
  }
// send output
header("Content-Type:application/x-shockwave-flash"); 
$movie->output();
?>
We should be able see five rectangles with blue shades. If not, there may be something wrong with the installation.
Ending Words
The PHP binding for Ming relies heavily on the object-oriented feature of PHP. Please consult the documentation for further information. This article has brought you to the start, so you can now move on with your own movies.
Happy coding!
When not playing the music, Iman S. H. Suyoto probably plays around with software development tools. He currently works as a trainer for web development technologies in World Wide Web Institute Indonesia. He has published several articles in MIKRODATA, an Indonesian computer and programming publication. In 1997, he started doing web development. He has been using PHP since 2000.

« Previous Page
1
|
2
|
3

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Iman S. H. Suyoto

Comment:



Comment:

(Maximum characters: 1200). You have characters left.