Calling the MMB commands directly from Macromedia Flash Action Script:
To communication between the Flash movie and MMB is used the fscommand command. It has two parameters: command and arguments. If you want to send a command to MMB, then the command parameter must be always string "mmb" and the second parameter (argument) should contain the MMB scripting action.
Example of usage of fscommand command in Flash movie:
// this example will fill the Time$ variable from the Flash variable
fscommand("mmb","Time$ =" + MMBCurTimeFull);
// this example will call the LoadText MMB command and fill the DirStr text object in MMB
fscommand("mmb","LoadText(\"DirStr\",\""+ DirString +"\")");
// this example will go to next MMB page
fscommand("mmb","NextPage()");
// this example will go to a defined MMB page - in this case "Page 2"
fscommand("mmb","Page(\"Page 2\")");
// this example will run an external mbd file (and jump to "Page 1" of this mbd) from the source folder where the application.exe is located
fscommand("mmb","RunMBD(\"<SrcDir>\\test_1.mbd\",\"Page 1\")");
To include a quotation mark in a string, precede it with a backslash character (\). This is called "escaping" a character. There are other characters that cannot be represented in ActionScript except by special escape sequences. The following table provides all the ActionScript escape characters:
Escape sequence
Character
\b
Backspace character (ASCII 8)
\f
Form-feed character (ASCII 12)
\n
Line-feed character (ASCII 10)
\r
Carriage return character (ASCII 13)
\t
Tab character (ASCII 9)
\"
Double quotation mark
\'
Single quotation mark
\\
Backslash
\000 - \377
A byte specified in octal
\x00 - \xFF
A byte specified in hexadecimal
\u0000 - \uFFFF
A 16-bit Unicode character specified in hexadecimal
Consult the Macromedia Flash documentation for more information about the fscommand command usage and Action Script programming as such.