Extension:Flash

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Flash

Release status: beta

Implementation Tag
Description embeds widget to run flash movies
Download here

The flash extension allows the display of flash movies within a wiki.

Contents

[edit] Syntax

[edit] Base Syntax

<flash>file=filename.swf|attribute=value|...</flash>

[edit] Attribute Reference

  • width=px or % (Modify the width of the object)
  • height=px or a% (Modify the height of the object)
  • play=true/false (Start playing the file or wait at first frame, default:true)
  • loop=true/false (Loop the animation, default:true)
  • quality=low/autolow/medium/high/autohigh/best (Predefine the quality)
  • devicefont=true/false (Change the look of the text used in flash file)
  • bgcolor=#?????? (? -> Hexadecimal integer: 0-9, A-F)
  • scale=showall/noborder/exactfit (Automatically adjust content to width and height)
  • menu=true/false (Show or hide the menu on right-click)
  • align
  • salign
  • base
  • wmode
  • SeamlessTabbing
  • flashvars=?var1=value1&var2=value2 (communicate two variables var1 and var2 to the movie)
  • name (object-specific)
  • id (embed-specific)
  • movie (object-specific)
  • src (embed-specific)

[edit] Examples

<flash>file=happy.swf|width=10%|height=30|quality=best</flash>
Shows the movie with the best quality with a width of 10% and a height of 30 pixels.

<flash>file=cool.swf|width=200|height=300|bgcolor=#FDE742|scale=exactfit</flash>
Shows the movie with a width of 200 and a height of 300. The background color is light-yellow (#FDE742). The content of the movie is stretched to the size of 200x300.

<flash>file=cool.swf|width=200|height=300|scale=exactfit|flashvars=?var1=value1&var2=value2</flash>
Shows the movie with a width of 200 and a height of 300. Two flashvars var1 and var2 are passed to the movie via url with respectively value1 and value2 (don't forget the question mark!). The content of the movie is stretched to the size of 200x300.

[edit] Code / Downloads

[edit] Installation

  1. Click on one of the versions above
  2. Copy the code into a file (e.g. Flash.php)
  3. Save the file in the extensions directory of your mediawiki folder
  4. Add the line include('extensions/Flash.php'); to the end of your LocalSettings.php file (The name of your file is case sensitive!)

Now you can use the extension with <flash>...</flash> in the wiki

[edit] Frequently Asked Questions

[edit] I can't upload Flash (*.swf) files!

If you cannot upload anything, then first enable uploads. Find the line #$wgDisableUploads = false; in LocalSettings.php and uncomment it.

By default, Mediawiki still blocks many files from being uploaded for security reasons. Add this line to your LocalSettings.php file, which will allow the upload of Flash files:

$wgFileExtensions[] = 'swf';

See also Help Uploading files

[edit] My flashvars are undefined

See carefully the examples before and make sure you added a question mark, before your string of flashvars name and value. Because the beta version of the extension is dealing with flashvars specifically, as added to the swf url.

flashvars=?var1=value1&var2=value2

[edit] Known Bugs

  • Possible security issues with Javascript that are not tested yet
  • The height and width options must be present for this to work in Internet Explorer.

[edit] Alternatives

Personal tools