Ming functions for Flash

PHP Manual
Prev |  | Next

# LIX. Ming functions for Flash

Warning
This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk.

# Introduction

First of all: Ming is not an acronym. Ming is an open-source (LGPL) library which allows you to create SWF ("Flash") format movies. Ming supports almost all of Flash 4's features, including: shapes, gradients, bitmaps (pngs and jpegs), morphs ("shape tweens"), text, buttons, actions, sprites ("movie clips"), streaming mp3, and color transforms --the only thing that's missing is sound events.

Note that all values specifying length, distance, size, etc. are in "twips", twenty units per pixel. That's pretty much arbitrary, though, since the player scales the movie to whatever pixel size is specified in the embed/object tag, or the entire frame if not embedded.

Ming offers a number of advantages over the existing PHP/libswf module. You can use Ming anywhere you can compile the code, whereas libswf is closed-source and only available for a few platforms, Windows not one of them. Ming provides some insulation from the mundane details of the SWF file format, wrapping the movie elements in PHP objects. Also, Ming is still being maintained; if there's a feature that you want to see, just let us know ming@opaque.net.

Ming was added in PHP 4.0.5.

# Requirements

To use Ming with PHP, you first need to build and install the Ming library. Source code and installation instructions are available at the Ming home page: http://ming.sourceforge.net/ along with examples, a small tutorial, and the latest news.

Download the ming archive. Unpack the archive. Go in the Ming directory. make. make install.

This will build `libming.so` and install it into `/usr/lib/`, and copy `ming.h` into `/usr/include/`. Edit the `PREFIX=` line in the `Makefile` to change the installation directory.

# Installation

Example 1. built into php (unix) mkdir <phpdir>/ext/ming cp php_ext/* <phpdir>/ext/ming cd <phpdir> ./buildconf ./configure --with-ming <other config options>

Build and install php as usual, restart web server if necessary.

Now either just add `extension=php_ming.so` to your `php.ini` file, or put `dl('php_ming.so');` at the head of all of your Ming scripts.

# Runtime Configuration

This extension has no configuration directives defined in `php.ini`.

# Resource Types

# Predefined Constants

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

`SWFBUTTON_HIT` (integer)

`SWFBUTTON_DOWN` (integer)

`SWFBUTTON_OVER` (integer)

`SWFBUTTON_UP` (integer)

`SWFBUTTON_MOUSEUPOUTSIDE` (integer)

`SWFBUTTON_DRAGOVER` (integer)

`SWFBUTTON_DRAGOUT` (integer)

`SWFBUTTON_MOUSEUP` (integer)

`SWFBUTTON_MOUSEDOWN` (integer)

`SWFBUTTON_MOUSEOUT` (integer)

`SWFBUTTON_MOUSEOVER` (integer)

`SWFFILL_RADIAL_GRADIENT` (integer)

`SWFFILL_LINEAR_GRADIENT` (integer)

`SWFFILL_TILED_BITMAP` (integer)

`SWFFILL_CLIPPED_BITMAP` (integer)

`SWFTEXTFIELD_HASLENGTH` (integer)

`SWFTEXTFIELD_NOEDIT` (integer)

`SWFTEXTFIELD_PASSWORD` (integer)

`SWFTEXTFIELD_MULTILINE` (integer)

`SWFTEXTFIELD_WORDWRAP` (integer)

`SWFTEXTFIELD_DRAWBOX` (integer)

`SWFTEXTFIELD_NOSELECT` (integer)

`SWFTEXTFIELD_HTML` (integer)

`SWFTEXTFIELD_ALIGN_LEFT` (integer)

`SWFTEXTFIELD_ALIGN_RIGHT` (integer)

`SWFTEXTFIELD_ALIGN_CENTER` (integer)

`SWFTEXTFIELD_ALIGN_JUSTIFY` (integer)

`SWFACTION_ONLOAD` (integer)

`SWFACTION_ENTERFRAME` (integer)

`SWFACTION_UNLOAD` (integer)

`SWFACTION_MOUSEMOVE` (integer)

`SWFACTION_MOUSEDOWN` (integer)

`SWFACTION_MOUSEUP` (integer)

`SWFACTION_KEYDOWN` (integer)

`SWFACTION_KEYUP` (integer)

`SWFACTION_DATA` (integer)

# Predefined Classes

The classes below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

Ming introduces 13 new objects in PHP, all with matching methods and attributes. To use them, you need to know about objects.

swfshape

swffill

swfgradient

swfbitmap

swftext

swftextfield

swffont

swfdisplayitem

swfmovie

swfbutton

swfaction

swfmorph

swfsprite

Prev | Home | Next
mssql_select_db | Up | ming_setcubicthreshold