Basic Functions

The typical function has syntax:

Function("parameter1","parameter2")

There are functions with zero, one or two parameters. The parameters in many cases could be replaced by string variables, the syntax however stays the same: Function("variable$","variable$")

Hide("OBJECT")

Hide object or a group of objects

Show
("OBJECT")

Show object or a group of objects. If you show animated gif the gif will start animate from the first frame.

Invert("OBJECT")

Show or hide object or group of objects. If the object/group was visible before this will hide it and oposite.

Example:

Hide
("Rectangle 1")

a$ = 'Text0'

Show("a$")

Note: MMB 4.4 alows you to modifyfrom one page object on another page Master Layer and Master Page included.

Use syntax:Hide("Page::Object")

For example to hide object Rectangle1 on Master Page you use:Hide("Master Page::Rectangle1")

Examples:

Hide("Master Page::Rectangle1")

Hide("Master Layer::Rectangle1")

Show("Page 1::Text")

VideoPlay("VIDEO OBJECT")

VideoStop("VIDEO OBJECT")

Play and stop video (AVI) object

RunMBD
("PATH TO MBD","PAGE LABEL")

Run an another mbd project in the same window. You can specify a Page where the new project will start – but you don’t have to.

This is very important command for creating big applications. You will put different blocks to separate mbd files and instead of moving between pages you will move between files.

This allows you to make really big multimedia without memory problems – the old project is deleted from memory as soon as new one is loaded.

Also if you using Full Screen Background (Kiosk)– this allows you to change the background bitmap jumping to another file and loading the background from there.

Don’t forgot to use <SrcDir> in the path !

Run
("PATH","PARAMETERS")

Run external programs. You can run file viewers, setup utilities etc..

Also you can run another mbd project in different window. Even if you create stand alone file (autorun.exe) – call the same file with another mbd file as a parameter. (<SrcDir>\autorun.exe <SrcDir>\otherfile.mbd). This will pen another project in different window – with different size and settings)

FirstPage
()

LastPage()

NextPage()

PrevPage()

Page("PAGE LABEL")

Page commands – jumping to different pages within the project.

In the Page command you can specify LASTPAGE instead of page name. This will jump to the last viewed page within the project.

Exit()

Quit the application immediately.

Minimize()

Minimize the application. This is the Minimize button action.

ExitTimer("MILLISEC")

Exit application after number of milliseconds. Be aware the PageTimer will cancel this command. Also clicking on any active object will cancel the command – this is important – you can provide user with button to go back not to exit.

With this command you can wait until sound will play, or display your logo for few seconds etc…

PageTimer
("MILLISEC","PAGE")

Got to a page after number of milliseconds. If you don’t specify the page – the next page will be taken. You can also use commands instead of page label: THIS_SCRIPT – will just run the script on the same page

THIS_PAGE – will start the same page again.

The difference is – page start will put all objects to its default stage and it will look also for background music – and then it will run the script.

Important: Clicking on any active object will cancel the command !

Using another PageTimer or ExitTimer will cancel the previous PageTimer.

With this you can make the self running presentation – if user doesn’t click on anything in few minutes MMB will go to the next page. If user click on some active object, the page timer will be canceled (User wants to stay on the page) and is up to you if you will leave it like that or start PageTimer again on Button click. For example you can make the portfolio show, where each item is on different page and if user wants to stop the show he will just press the button Pause.

DisplayValue("TEXTOBJECT","VARIABLE")

Display an integer part of the variable in some text object. Good for counters etc…

Message("ANYSTRING","VARIABLE")

Mostly for debugging. You can make pop-up the message with an integer value of some variable.

Return()

Return from executing the script. You can use it in if – end statement.

AGifPlay("ANIGIF OBJECT")

AGifStop("ANIGIF OBJECT")

AGifReset("ANIGIF OBJECT")

Animated Gifs commands. The play will play anigif from the actual frame, the stop will stop the animation.

The reset will set the actual frame to the first frame. How the anigif will animate depends on the Anigif properties.

RunScript("OBJECT")

Run script of some other object.

The best would be to run Script Object script so you can build some kind o global functions. However you can run script from any object – the Mouse Up script will run.

You can run the same script – and you will create recursive calls. Unless you are sure what you are doing don’t use recursion.

ScriptTimer("OBJECT","MILISEC")

Run script on object or Script object after a number of milliseconds. (See RunScript). Good for hiding some message after few seconds etc…

MCICommand("MCI STRING")

MCI commands.

This will send a string to a device. The string will tell the device what to do.

With this command you can access the devices for playing MPEG, video discs, record sound, play animation etc..

You can use <SrcDir>, <SrcDrive> or <CD> in the string.

Also use <This> with the parent comand to tell the device the MMB window will be the parent.

Here is a small sample to play MPG movie inside the mbd project in the position (100,50,100,100):

MCICommand("open <SrcDir>\sample.mpg alias MPEG style child parent <This>")

MCICommand("put MPEG window at 100 50 200 200")

MCICommand("window MPEG state hide")

MCICommand("play MPEG")

Example: (Open and close door on CD (beer holder))

MCICommand("set cdaudio door open")

MCICommand("set cdaudio door closed")

Some of the MCICommand functions can return a value (for example number of tracks on CD)

The variable MCIResult will have the result number.

Example: (returns number of tracks on CD)

MCICommand("status cdaudio number of tracks")

DisplayValue("Text","MCIResult")

Example2: (returns length (in seconds) of track 1)

MCICommand("status cdaudio length track 1")

DisplayValue("Text_totalsec","MCIResult")

Example3: (returns status of CD audio)

MCICommand("status cdaudio mode")

if (MCIResult==-2) then

Show("Playing")

end

if (MCIResult==-1) then

Show("Stopped")

end

For a complete understanding and the syntax, consult Microsoft Documentation.

This is accessing the device directly – be prepare for crashing if you are going to experiment.

OpenFile(" filter", "default")

Opens The File Open Dialog Box. The selected file will modify <File> shortcut and OpenFile$ string variable
The Filter

Example:

MPEG Files (*.mpg)|*.mpg|All Files|*.*||

This will create in file open dialog box two choices MPEG Files and All Files.

Note the | character between the items and the double || on the end.

The format is : Text displayed in The combo box |associated extension||

The other parameter is the default extension. Example

After using this command you can use <File> whenever you will use <SrcDir>

Example:

OpenFile("Text Files (*.txt)|*.txt|All Files|*.*||","*.txt")

Message("The file you selected is","OpenFile$")

LoadText("Paragraph","<File>")

This example will load a text file and display it in the Paragraph object (with label Paragraph) and display a message box with the path.

FileString("substring","variable")
Use after OpenFile
Searches <File> string for the first match of a substring.
You put the substring (for example): .wav
If the <File> has substring '.wav' in its string the variable (Second Parameter) will become 1

OpenFile("All Files|*.*||","*.*")

FileString(".wav","result")

if (result = 1) then

WavePlay("<File>")

end

InstallFont
If you using some font which user might not have on his system – it will be substituted with other font – that’s not the effect you would like.
Using InstallTTF you can temporary install your font on users computer. This font will be uninstalled after you exit the application. The example: Put your funny.ttf font on the distribution CD and on the beginning of the application call: InstalFont(“<SrcDir>\funny.ttf”)

FileExist("PATH TO FILE","VARIABLE")

Tests if external file exists. If yes the VARIABLE will get value 1 else 0

Sound & CD Commands

SaveVariable/LoadVariable

Print Commands

Text-To-Speech Commands

MP3 List Commands

External Image Commands

Image Matrix Commands

Plugins and Plugin Commands\

SysCommand

Animation Commands