Add ActionScript code 245
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
“Test an
ActionScript sample” on page 244
.
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"+cu"title"];
000_ExploringStudio.book Page 245 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...