# &app; Manual V&manrevision;

2005, 2006
Rob Savoye
GNOME Documentation Project

&legal;

Rob
Savoye

    	    rob@senecass.com

&appname; Manual V&manrevision;
&date;

Rob Savoye rob@senecass.com Updated for the alpha release.

Free Software Foundation

This manual describes version &appversion; of &appname;.

## Introduction

Gnash is a Free Flash movie player, which works either standalone, or as a Firebox/Mozilla plugin.

### Gnash Overview

Gnash is originally based on the code of GameSWF, by Thatcher Ulrich. GameSWF was the most advanced of the free flash movie player projects, and implements a fairly broad set of Flash Format v7 compliance. GameSWF was unsupported public domain software though, and not really setup to be an industrial strength project that could be used by everyone that uses Firefox. So in early December of 2005, GameSWF was forked. After being rearranged in GNU project style, development of the plugin was started.

Gnash works as standalone player, as a Mozilla Firefox plugin, and as a Konqueror plugin, called Klash. The plugins use the standalone player for processing, but embed the output into the browser.

Currently Gnash uses OpenGL to get a high quality rendered image. There are plans to write a Cairo back-end to give Gnash a performance boost on graphics processors without 3D hardware acceleration, and to run in a framebuffer, with no windowing system at all.

Included in the Gnash is an XML based messaging system, as specified in the Flash specification. This lets a flash movie communicate over a TCP/IP socket, and parse the incoming XML message. This lets a movie be a remote control for other devices or applications.

#### Plugin Overview

The plugin currently works by creating a new window in the standalone player that is connected to the browser window in Firefox.

All movies are downloaded to /tmp, and played from there. Many web pages have IE specific Javascript that fail to launch with Firefox, so it never loads the plugin.

#### Standalone Player Overview

The standalone player supports both SDL and GTK2. The SDL support is more portable, and the GTK support makes it better integrated into Firefox as a plugin. When using GTK, there is a new menu activated by a right-button mouse click that can be used to control the movie.

#### Flash Support:

Many of the movies I come across while randomly web surfing play fine in Gnash. Gnash supports the majority of Flash opcodes up to SWF version 7, and a wide sampling of ActionScript classes for SWF version 7. All the core ones are implemented, and many of the newer ones work, but may be missing some of the methods. All unimplemented opcodes and ActionScript classes and methods print a warning when using -v with gnash or gprocessor. Using gprocessor -v is a quick way to see why a movie isn't playing correctly.

There are plans to work towards supporting all the SWF version 8 or greater opcodes, as well as as implementing the missing methods and ActionScript classes. During the first few months of Gnash's existence as a project, most of the focus has been towards portability issues, and getting the plugin to work. Now that the plugin works, more focus will be spent on catching up to full compliance with version 7 and beyond.

Currently implemented ActionScript classes are: Array, Boolean, Date, Key, Math, Mouse, MovieClip, Number, Object, Sound, String, XML, XMLNode, XMLSocket.

Partially implemented classes are: MovieClipLoader, NetConnection, LocalConnection, TextField, TextFormat.

Unimplemented classes are: Accessibility, Error, Function, LoadVars, Microphone, NetStream, Selection, SharedObject, Stage, System, Button, Camera, Color, ContextMenu, CustomActions, Video

Unimplemented Opcodes are: Throw, Implements, Extends, enum_object, Try, new_method, enum_object, md length, md substring, md chr, delete, get target

There is currently no FLV video or more than minimal AMF data support, or loading of external jpegs.

## Gnash Usage

Currently only the standalone player is fully operational. You can execute any flash movie from the command line by just supplying the file name. No command line options are required to just play the movie using the default actions. So if you type:

`gnash samples/car_smash.swf`

It'll create a window and play this movie. In this case it's a simple animation of a car driving and swerving and finally crashing.

### Gnash Command Line Options

While by default no options are necessary, there are options that can be used to change `Gnash's` basic behavior.

gnash [options] file

-h

  Print usage info.

-s factor

  Scale the movie up/down by the specified factor.

-c

  Produce a core file instead of letting SDL trap it. By default, SDL traps all signals, but sometimes a core file is desired to assist with debugging.

-d num

  Number of milli-seconds to delay in main loop. The main loop polls continuously with a delay to adjust how long `gnash` sleeps between iterations of the loop. The smaller the number, the higher the CPU load gets, and of course, you get more iterations of the main command loop.

-p

  Run full speed (no sleep) and log frame rate.

-a

  Turn anti-aliasing on/off. (obsolete)

-v

  Be verbose; i.e. print debug messages to stdout

-va

  Be verbose about movie Actions.

-vp

  Be verbose about parsing the movie. Warning, this can generate a lot of text, and can affect the performance of the movie you are playing.

-ml bias

  Specify the texture LOD bias (float, default is -1) This effects the fuzziness of small objects, especially small text.

-w

  Write a debug log called gnash-dbg.log. This gets a record of all the debug messages whether they are printed to the screen or not.

-j

  Specify the width of the window. This is mostly used only by the plugin.

-k

  Specify the height of the window. This is mostly used only by the plugin.

-1

  Play once; exit when/if movie reaches the last frame. This is the default.

-r [0|1|2]

  0 disables rendering and sound (good for batch tests)

  1 enables rendering and sound (default setting)

  2 enables rendering and disables sound.

-t sec

  Timeout and exit after the specified number of seconds. This is useful for movies that repeat themselves.

-x id

  This option is only used by Mozplugger when running the standalone player from within a web browser like Firefox. This specifies the X11 window ID to display in.

-b bits

  Bit depth of output window (16 or 32, default is 16)

### Gnash Interactive Control Keys

While a movie is playing, there are several control keys. These can be used to step through frames, pause the playing, and other actions.

CTRL-Q

  Quit/Exit

CTRL-W

  Quit/Exit

ESC

  Quit/Exit

CTRL-P

  Toggle Pause

CTRL-R

  Restart the movie

CTRL-[ or kp-

  Step back one frame

CTRL-] or kp+

  Step forward one frame

CTRL-A

  Toggle anti-aliasing (doesn't work)

CTRL-T

  Debug. Test the set_variable() function

CTRL-G

  Debug. Test the get_variable() function

CTRL-M

  Debug. Test the call_method() function

CTRL-B

  Toggle background color

&sources; &internals; &appendix;

## Authors

Gnash is maintained by Rob Savoye rob@senecass.com. Please send all comments and suggestions to gnash@gnu.org Please use this link to submit a patch or this link to file a bug report. I am available for consulting on a variety of renewable energy and open source technologies. More details at http://www.senecass.com

The following people all contributed code to GameSWF, which was the original code base for Gnash. I was also a GameSWF contributor. The primary author of GameSWF is Thatcher Ulrich tu@tulrich.com. Other individuals that contributed code are: Mike Shaver, Thierry Berger-Perrin, Ignacio CastaÃ±o, Willem Kokke, Vitaly Alexeev, Alexander Streit.

&fdl-app;