MACROMEDIA FLASH 8-GETTING STARTED WITH FLASH Getting Started page 126

Table of Contents

Advertisement

126 Tutorial: Building Your First Flash Application
Enter ActionScript code for the slide show
Now you will enter the ActionScript code that makes the slideshow
animate each new slide into place when the Next button is clicked. After
you add the code, your Flash document will be complete.
To add the ActionScript code to the Flash document:
1.
In the Timeline, make sure Frame 1 of the actions layer is still selected.
2.
In the Actions panel, delete all the code you entered in
ActionScript sample" on page
The Actions panel should now be empty of code.
3.
Copy the following code and paste it into the Actions panel.
/*The following four sections contain the data
/*for each menu item.
/* 0 */
var image0title:String = "Summer salad";
var image0desc:String = "Butter lettuce with apples,
blood orange segments, gorgonzola, and raspberry
vinaigrette.";
var image0uri:String = "images/image0.jpg";
/* 1 */
var image1title:String = "Turkey and Sun-dried Tomato
Sandwich";
var image1desc:String = "Fresh roasted turkey with sun-
dried tomatoes, garlic aioli, and havarti.";
var image1uri:String = "images/image1.jpg";
/* 2 */
var image2title:String = "Seared Salmon";
var image2desc:String = "Filet of wild salmon with
caramelized onions, new potatoes, and caper and tomato
salsa.";
var image2uri:String = "images/image2.jpg";
/* 3 */
var image3title:String = "New York Cheesecake";
var image3desc:String = "Creamy traditional cheesecake
served with chocolate sauce and strawberries.";
var image3uri:String = "images/image3.jpg";
var currImage:Number = 0;
var totalImages:Number = 4;
menu_mc.title_txt.text = this["image"+currImage+"title"];
125.
"Test an

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-GETTING STARTED WITH FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents