Three ways to use Form2Flash
Form2Flash is a cgi-bin program, and can be used like any other cgi-bin
program. You can use Form2Flash as the ACTION of a form, as the HREF of
a link, and last but not least: as the VALUE/SRC of a Flash object.
Form
Specify Form2Flash as the ACTION of the form, and use hidden fields to
select your Flash movie. When the user clicks on the Submit button of
the form he will get the movie full-screen. For example:
<form action="/cgi-bin/Form2Flash.exe">
<input type=hidden name=Cfg value="Jeroen">
<input type=hidden name=File value="MyMovie.swf">
...
<input type=submit value="Start Movie">
The hidden "Cfg" parameter specifies the configuration you want to use.
The hidden "File" parameter specifies the movie to play. You can specify
other fields in the form for use in the movie.
Link
Since Form2Flash can be used in a form it can also be used in a link,
and can therefore be "hidden" under a clickable image or button or
something. You can use
The UrlBuilder to
determine the exact URL for the link. A typical link would look
something like this:
<a href="/cgi-bin/Form2Flash.exe?File=MyMovie%2eswf&Cfg=default">Start!</a>
Flash object
The easiest way to insert a Flash movie into an HTML page is to use
AfterShock, a utility that comes with the Flash editor. Check the HTML
that AfterShock generates and you will find the name of your movie in
two places:
...
<PARAM NAME=movie VALUE="MyMovie.swf">
...
<EMBED SRC="MyMovie.swf">
...
You will have to change the name of your movie "MyMovie.swf" by hand.
Use The UrlBuilder to see what to change
it into.
Your first Form2Flash movie
It's quite easy to create a Flash movie that can be used by Form2Flash.
There are some quirks you'll run into, Form2Flash can do just a couple
of things with movies. Here is a quick guide how to create a movie
in which a text will be replaced by a text from a form:
- Start the Flash editor. Use the text-tool and create a text field
containing "<macro textfield1>". Do not include the
double-quotes, but do include the less-than and greater-than
characters.
- Create another text field containing all the characters in the
alphabet, both lowercase and uppercase, and including special
characters such as a space. Form2Flash needs this to be able
to replace characters in the macro. Change the color of this text
field to the same color as your background, so that the text is
invisible. Here is an example for the text with all the
characters that are possible in html (215 in all):
- Save your movie as "test.swf".
- Create a small html document containing the following form:
<html>
<body>
<form action="/cgi-bin/Form2Flash.exe">
<input type=hidden name=Cfg value="default">
<input type=hidden name=File value="test.swf">
Enter your name: <input type=text name=textfield1>
<input type=submit value="Start Movie">
</form>
</body>
</html>
- Upload the movie and the html to your webserver.
- Install Form2Flash on your webserver if you haven't done so already.
- Use your browser to view and submit the form.
If you are having trouble (I can't imagine why) then download this
ready-made
test.fla flash file to get you started.
Parameters
Form2Flash accepts fields in a form as parameters. Certain fieldnames
have a special meaning to Form2Flash. All other fieldnames can be used
in your Flash movie, to change it's behaviour.
| Parameter |
Description |
| cfg |
The name of the configuration you want to use for this movie.
See Configuring Form2Flash for more
information about the configuration file.
|
| file |
The filename of the movie you want to use. It should be a path
relative to the Root-path in the configuration.
|
| debug |
A number from 1 to 3. Higher numbers will give more information.
If the debug-parameter is present then Form2Flash will not return
the movie itself, but an html-page with a lot of information about
the movie.
|
| [other] |
You can specify any parameter you want and it will be available
as a "macro" inside the Flash movie. For example, if your form
contains a field called "NAME" then the following string will be
replaced by whatever the user enters into that field:
|
Debugging
- The movie does not appear at all
- Try entering the URL of the movie directly into your browser.
You can use
The UrlBuilder to
determine the exact URL of your movie. A typical URL would look
something like this:
/cgi-bin/Form2Flash.exe?File=MyMovie%2eswf&Cfg=default
- My text doesn't change
- The text in your Flash movie should be something like
"<macro NAME>". Don't forget the smaller-than
and greater-than characters. Use the debug-parameter to find out
what is happening inside Form2Flash. A typical debugging-URL looks
something like this:
/cgi-bin/Form2Flash.exe?File=MyMovie%2eswf&Cfg=default&debug=1
- My text has gaps
- Create a hidden textfield in your movie that contains all the
characters in the font. Otherwise only a subset of the font is
available to Form2Flash. Here is a list of characters that you
can cut & paste into Flash:
|