It is quite easy to send commands to the Flash Player, which is running the movie. From the Flash basic course you know three ways of running Flash movie. Firstly it's possible to display the movie as a part of HTML page, where SWF file is embedded. Also (if Flash Player is installed on user's computer) it is possible simply to run SWF file alone. And the third way is to publish the movie as a Projector – independently running executable file, which has a Flash Player inside it.
The following way of communication works only with standalone Flash files and Projectors. If you send these commands while your SWF file is ran from HTML page – it won't work. So, when you complete your example you need to compile a Projector (set this option in Publish Settings) or try to click and run SWF file without the browser.
Create a new file and place there any content to display. We have this clock.
Add four buttons with the following code in their event handlers
on (release) {
fscommand("fullscreen",false);
}
on (release) {
fscommand("showmenu",false);
}
on (release) {
fscommand("allowscale",false);
}
on(release) {
fscommand("quit",true);
}
Compile your movie as a projector and run it. Test the buttons. The first displays your movie full screen, the second - eliminates the menu, the third – makes the movie not to scale the content even if the window is scaled. Last button unloads the movie.
As we said our example, which is embedded in HTML doesn't work, but yours , if ran standalone, it will work.
Those techniques are important for movies which are distributed standalone – learning applications, games, interactive CD's and others.