ABOUT THE FLASH PLUGIN (FULL EDITION ONLY,
WINDOWS ONLY)
1. How to play a
Flash movie from within Adventure Maker?
2. How to stop
all the Flash movies that are playing?
3. Does the end-user need to install the Flash Player?
4. How to detect whether the Flash Player is installed or not?
5. How to provide the end-user with the Flash Player?
6. How to send a message from the Flash movie to
Adventure Maker in order to change the value of a variable?
1. How to
play a Flash movie from within Adventure Maker?
To play a flash movie from within
Adventure Maker, follow these steps:
1. Make sure that the Flash
Player is installed on your computer (it normally is, but if it is not you can find it here).
2. Launch Adventure Maker.
3. Enable the Flash Plugin. To do
so, go to the Project Properties window and check the checkbox
"Flash Plugin" that is under the "Plugins" tab.
4. Open the "Hotspot
Properties" of the hotspot that should play a Flash movie when it is clicked, and
check the option "When the hotspot is clicked, play a
Flash movie" that is under the "Plugins" tab.
5. Select the Flash file to play
and enter the coordinates where you want to play it (or leave the default coordinates).
Then click "OK" to close the Hotspot Properties window.
Note(1): If you
wish to automatically go to another frame after the Flash movie has played, check the
option "Execute VBS code when it reaches the end (advanced)" and enter the
following code into the text field:
GoToFrame
"FRAME_NAME"
where you must replace FRAME_NAME
with the name of the destination frame (do not forget the quotation marks).
If you wish to use the Flash
movie as a transition for moving to another frame, make sure NOT to check
the option "Automatically close the movie when it reaches the end" but instead
to go to the "Frame Properties" of
the destination frame and to check the option "When the
frame is loaded, remove all the open Flash movies" that is under the
"Plugins" tab.
Note(2): When
you distribute your project, make sure that the end user has the Flash Player installed on
his/her computer (read below for details).
2. How to
stop all the Flash movies that are playing?
To stop all the Flash movies that
are playing, simply check the option "remove all the
open Flash movies" from the "Plugins" tab of either the
"Hotspot Properties" or the "Frame Properties" windows.
3.
Does the end-user need to install the Flash Player?
In order for the code above to
work properly, the Flash Player must be installed on the end-user computer.
If the end-user has visited at
least one website that makes use of Flash, it is very likely that the Flash Player is
already installed. Otherwise, you must provide the end-user with the Flash Player. Read
the question 5 for details.
4. How
to detect whether the Flash Player is installed or not?
The Flash plugin automatically
displays an error message when Flash is not installed.
However, if you want to create an
additional routine to check whether the Flash Player is installed or not, you can use the
following VBScript code (for advanced users):
If
Action.IsComponentInstalled("ShockwaveFlash.ShockwaveFlash") = False Then
MsgBox "The Flash Player is not installed."
End If
5. How to
provide the end-user with the Flash Player?
You have two possibilities:
1. First possibility: Add a note to
the "System Requirements" of your software. For example, you can say:
Note that you are
not forced to link to the Adventure Maker website. For example, you can link directly to
the Flash Player Download Center instead.
2. Second possibility: Include
the Flash Player into the installation package of your software, and set it to run at the
end of the installation process.
To do so, just add it to the list
of "root files" and "files to run at the end of the installation" in
the "Distribution Options" window.
Note that if you plan to include
the Flash Player into the installation package of your software, you must obtain a
Distribution License from the authors of Flash. Just complete their online licensee form,
available here. After filling the form, you will be provided with a link to
download the redistributable version of the Flash Player, which you can include in the
package of your Adventure Maker project.
6.
How to send a message from the Flash movie to Adventure Maker in order to change the value
of a variable?
1. Create a new button (to do so,
create for example a rectangle, then right-click on it and click "Convert to
Symbol...", then select "Button", and then click "OK")
2. Select the button that you have
created and click "+" under the "Actions" panel, as shown in the
following screenshot:
3. In the popup menu, click
"Actions"->"Browser/Network"->"fscommand".
4. Enter a command and some
parameters as shown in the following screenshot:
(you can replace COMMANDNAME and
PARAMETERS with any string of your choice)
5. Create the SWF file (to do so,
click "Publish" from the "File" menu).
6. Enable the Flash Plugin (to do
so, go to the Project Properties and enable the Flash Plugin from the "Plugins"
tab).
7. Create a new hotspot and use the
option that is under the Plugins tab of the Hotspot Properties ("when the hotspot is clicked, play a Flash movie")
to play the SWF file that you have created before.
8. Go to the project Global VBS
Procedures (to do so, click "VBS Procedures (advanced)"
from the Project Menu) and add the following procedure:
Sub
Flash1_FSCommand(p)
If p(0).Value = "COMMANDNAME" and p(1).Value =
"PARAMETERS" Then
'TYPE HERE WHAT MUST HAPPEN!
End If
End Sub
where you must replace the code
"'TYPE HERE WHAT MUST HAPPEN" with something like MYVARIABLE=NEWVALUE, or
whatever fits your needs.
Important note: do not
change the name "Flash1", otherwise it will not work. That is due to
the fact that when you play a Flash movie with the Flash Plugin, the movie object is
called Flash1, unless there is already a movie object called Flash1, and in that case it
is called Flash2, etc. (allowing you for example to open several instances of the same SWF
file at the same time).
Note that p(0).Value corresponds to the
"COMMANDNAME" and p(1).Value corresponds to the "PARAMETERS" exactly as you have entered them
at step 4 (see above). You can read the "how to intercept the events" section of
the Using ActiveX Components page to better understand
how the VBScript code above works.
Note: If you have a hotspot that is
visible (enabled) depending on the value of a variable, you may want to use the Action.UpdateHotspotsState
function to make sure that it is still displayed correctly after that you have changed the
variable from the Flash component (read the Language
Reference page for details on that function). |