script command: SWF

What this does
This command places an external SWF file into the game. This is useful for displaying animations and videos, or for temporarily adding menus and features to the game. SWF files are created in Flash. They can be animations or contain code. This command can also place image files and internal movieClips.

How to use this

First, you select the SWF file you want to place into the game. You can also press the ... button to browse through the swf folder.


Then you tell it where you want to put it...


...and what to call it.


You can optionally specify a layer to put it on to control overlapping with other SWF files. Typing -1 tells it to put it on top of everything else.

And finally you choose whether you want the script to keep running or you want it to stop and wait for this SWF animation to finish.


You can also pass settings to the imported SWF file or movieClip by adding variables to the box at the bottom. Most of the time, you'll use this to set the file's position on the screen by setting its _x and _y variables.



Details

You can place SWF files, image files, or internal movieClips.
SWF: swf\myFile.swf
IMAGE: swf\myFile.jpg
MOVIECLIP: enemySprite
When you place internal movieClips, you type in a linkage name instead of a file path.


There are a number of pre-defined movieClips in the game where you can place SWF files. You can almost think of them as graphics layers.
HUDThis is where you'll typically display HP bars and menus. This movieClip does not scroll and it's displayed on top of everything else. It does not get cleared between maps.
OVERLAYYou can use this to place images over parts of the map. This movieClip scrolls with the map. It displays above the map and sprites, but below the HUD. It gets cleared between maps.
thisThis movieClip refers to the sprite running this script. Anything placed inside will be part of this sprite and move with it.
SPRITESAnything placed here will collide with the player unless the SWF file's 'noCollide' variable is set to true. This movieClip scrolls with the map. It contains all of the characters and objects in the level.
UNDERLAYIf the level's map is transparent, you can display an image here instead of map tiles. This movieClip scrolls with the map. It displays underneath the map and sprites. It gets cleared between maps.
PANORAMAThis can place a background image behind the game. This movieClip does not scroll and it's displayed underneath everything else. It gets cleared between maps.


This is the internal name of the SWF file you're placing. If you give it the same name as something else, it might replace it. You'll use this name to target or remove this SWF animation later. For example, the variable command would access variables inside of a placed SWF file like so:
HUD.swfName.myVariable
If you leave the name blank, then you won't be able to remove the SWF later because it'll be given a random name.

Layers control which order things will overlap. If you place something into the game's SPRITES movieClip, the layering will be handled automatically by the game. Be careful not to give this SWF the same layer number as another SWF or sprite in that movieClip, or it'll get replaced by this one. If you're not sure what to use, just type -1 and it'll safely be placed above everything else in that movieClip.


This basically just waits until the SWF file reaches its last frame. If you're placing a special effect such as an explosion, you might want the script to continue while it animates. On the other hand, if you're placing a menu or dialog box that the player interacts with, then you'll probably want the script to stop and wait until it's finished. All the textboxes in the game are actually SWF commands that place a textbox and then wait for it to close.


If you were placing your own custom-made textbox. This is where you'd tell it what to say. I've already included a bunch of SWF files in the "swf" folder. Most of them have settings. You can look up what each one's settings are in the "parameters.txt" file in the same folder.

Last updated: August 26, 2011