Extension:Flashlets

Example usage
Below is a syntax example, you can test it out in the Peerix Sandbox.  class Ball { static var app : Ball; function Ball {

// Create a ball _root.createEmptyMovieClip('ball',1); var r = 50; var w = r*2; var k = 0.93; var colours = [0xffffff,0xffcccc,0xff0000,0x000000]; var alphas = [100,100,100,100]; var ratios = [0,5,50,250]; var matrix = {matrixType:'box',x:-r*1.3,y:r*1.3,w:r*4,h:-r*4,r:0}; with (_root.ball) { lineStyle(0,0,0); beginGradientFill('radial',colours,alphas,ratios,matrix); moveTo(0,-r); curveTo(r*k,-r*k,r,0); curveTo(r*k,r*k,0,r); curveTo(-r*k,r*k,-r,0); curveTo(-r*k,-r*k,0,-r); endFill; x = 0.0; y = 0.0; vx = 2.0; vy = 0.0; mx = 2.0; my = 12.0;

// Dynamics (called each frame) onEnterFrame = function { with (this) { x += vx; y += vy; vy += 0.5; if (vy > my) vy = my; if (x < 0)  { x = 0; vx = mx; } if (x > 200) { x = 200.0; vx = -mx; } if (y > 200) { vy = -my; y = 200.0; } _x = x;					_y = y;					} };			}		}

// entry point static function main(mc) { app = new Ball; }       }

Installation
First create a directory called flashlets (case sensitive, i.e. lowercase 'f') in you wiki's extensions directory. Copy the Flashlets source code from OrganicDesign:Extension:Flashlets.php and the Container.swf file and save them in the newly created flashlets directory. (you'll need to use right-click and "save as" to save Container.swf becasue it will open in your browser if you just click the link normally).

Include the flashlets.php file you downloaded and saved using a statement in your LocalSettings.php file as usual, for example: include("$IP/extensions/flashlets/Flashlets.php");

Before Flashlets will work you need to download and install the free open-source MTASC ActionScript compiler from www.mtasc.org. They have pre-build packages for Linux, OS X and Windows, so download the appropriate version onto your system. The default settings for the Flashlets extensions assume that the mtasc files are unpacked into the flashlets directory, but you can install it any way you like as long as you set the $wgFlashletsMTASC and $wgFlashletsCP globals to match your MTASC install. The directory structure should now look like the following example: extensions/flashlets/ extensions/flashlets/Flashlets.php extensions/flashlets/Container.swf extensions/flashlets/mtasc/ extensions/flashlets/mtasc/CHANGES.txt extensions/flashlets/mtasc/Future.txt extensions/flashlets/mtasc/mtasc extensions/flashlets/mtasc/Readme.txt extensions/flashlets/mtasc/std extensions/flashlets/mtasc/std8