250 Tutorial: Building Your First Flash Application
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_ExploringStudio.book Page 250 Tuesday, August 30, 2005 9:30 AM
Summary of Contents for STUDIO 8-EXPLORING STUDIO 8
Page 1: ...Exploring Studio 8...
Page 8: ......
Page 42: ...42 Learning Studio...
Page 134: ...134 Web Development Workflow...
Page 136: ......
Page 162: ...162 Tutorial Creating Page Mock ups...
Page 182: ......
Page 194: ...194 Tutorial Handling Photographs...
Page 254: ...254 Tutorial Building Your First Flash Application...
Page 266: ...266 Tutorial Building a Video Player Flash Professional only...
Page 268: ......
Page 294: ...294 Tutorial Adding Content to Pages...
Page 324: ...324 Tutorial Formatting Your Page with CSS...
Page 332: ...332 Tutorial Publishing Your Site...
Page 342: ...342 Tutorial Setting Up Your Website for Contribute Users...
Page 350: ...350 Index...