Publish your document 131
The line of code immediately after the function definition tells Flash to
execute the
nextMenuItem
function when the next_btn instance receives a
mouse click.
next_btn.addEventListener("click", nextMenuItem);
Because the
nextMenuItem
function is now set up to listen for mouse
clicks, it is called an
event listener
. This is why the
addEventListener()
method is used to tell flash to execute the function when the mouse click
event occurs.
While the code described in this section is relatively simple, it still relies on
a number of ActionScript concepts that are beyond the scope of this
tutorial to describe. For a thorough introduction to these concepts and
additional ActionScript tutorials, see
Learning ActionScript 2.0 in Flash
and
Flash Tutorials
.
Publish your document
Now that you have completed your Flash document, you are ready to
publish it in a web page. The first step in this process is to save the FLA
version of your document as a compressed SWF version of the file. This
SWF version has a much smaller file size; because of this, it loads easily in a
web browser.
To publish your document as a SWF file:
1.
Select File > Publish Settings.
2.
In the Publish Settings dialog box, select the Formats tab and verify that
only the HTML and Flash check boxes are selected.
This causes Flash to publish only the SWF file and an HTML file to
display it in a web browser.
3.
Still in the Publish Settings dialog box, select the Flash tab and verify
that Flash Player 8 is selected in the Version menu.
This causes Flash to export the SWF file in Flash 8 format.
4.
Select the HTML tab and verify that Flash Only is selected from the
Template menu.
This causes Flash to generate only a simple HTML file to display the
Flash document in a browser.
000_Getting_Started.book Page 131 Friday, September 2, 2005 12:22 PM
Summary of Contents for FLASH 8-GETTING STARTED WITH FLASH
Page 1: ...Getting Started with Flash...
Page 26: ...26 Introduction...
Page 94: ...94 Flash Basics...
Page 152: ...152 Index...