Chapter 9. Using Ming
Ming is a library written in C that provides a simple API for creating SWF files (described in Chapter 8). In addition to the Perl wrapper described in this chapter, Ming comes with interfaces to PHP, Python, Ruby, Java, and C++. The Ming library was created by Dave Hayden of Opaque Industries and is released under the LGPL (Lesser GNU Public License).
Most web-graphics designers create SWF files with Macromedia’s Flash software, which provides a GUI and tools for drawing and manually piecing together the timeline of a movie. With Ming, you can create an assembly line of scripts that automatically update the SWF content of your web site. You can also use Ming with CGI scripts to dynamically generate SWF documents from various data sources. In some cases, it may even make sense to use Ming instead of the Flash tool, or to supplement Flash with Ming at various places in the workflow.
This chapter is divided into three sections. The first introduces a comprehensive Flash application (a game called Astral Trespassers) that touches on all of the basic Ming objects. Next is a reference guide to Ming’s Perl interface. The last section of the chapter provides solutions to some problems you may encounter when using Ming. By the end of the chapter you will be able to draw circles using cubic Bezier curves, attach a preloader to your movie, and communicate between an SWF client and a Perl backend using sockets.
Get Perl Graphics Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.