next up previous contents
Next: Methods Up: FFish Script Objects Reference Previous: send   Contents

Form Object

Description

available: SWFKit Pro

The Form object enable you to create applications with multiple forms. It can represent a modal or a modeless form.

A form is a modal or modeless window contains a playing Flash movie(SWF file). The Form object provides methods to create a form and get data from a form.

Each form has a return string. When the form is closed, you can test the return string of the form to see what action that has been done by the form. The return string can be returned by the ffish_ret command(see below) or the close method. If the form is closed by the x button, the return string will be empty.

The playing flash movie in the form can call all the fscommands such as ffish_run, ffish_eval which are supported by swfkit. The form object support one more fscommand than the main movie: the ffish_ret command

fscommand("ffish_ret", "the ret value");

When the movie calls the fscommand, the form will be closed and return a string "the ret value".


Syntax

new Form();


Usage

1. Define a form
The form is a flash window, so firstly we must specify the movie to play in it.

var form = new Form;
form.movie = getMovies()[1];
form.showCaption = true;
form.canDrag = true;
form.caption = "A test";
2. Initialize the variables in the movie

form.initVars = "from=100&to=200&dir=c:\\";
3. Define the onExit event handler to get data from the movie in the form

form.onExit = function (ret)
{
    trace("The return value is: " + ret);

    trace(this.getVariable("_root.from"));
    trace(this.getVariable("_root.to"));
    trace(this.getVariable("_root.dir"));
}
4. Display the form

if (form.show() == 'ok')
{
    ...
}




Subsections
next up previous contents
Next: Methods Up: FFish Script Objects Reference Previous: send   Contents
Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.