The line of code immediately after the function definition tells Flash to
execute the
nextMenuItem
mouse click.
next_btn.addEventListener("click", nextMenuItem);
Because the
nextMenuItem
clicks, it is called an event listener. This is why the
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.
function when the next_btn instance receives a
function is now set up to listen for mouse
addEventListener()
Publish your document
131
Need help?
Do you have a question about the FLASH 8-GETTING STARTED WITH FLASH and is the answer not in the manual?