EasyManua.ls Logo

MACROMEDIA FLASH 8-GETTING STARTED WITH FLASH - Page 127

MACROMEDIA FLASH 8-GETTING STARTED WITH FLASH
152 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Add ActionScript code 127
menu_mc.description_txt.text =
this["image"+currImage+"desc"];
for (var i:Number = 0; i<totalImages; i++) {
slideShow_mc.slides_mc["holder"+i].loadMovie(this["image"
+(i)+"uri"],slideShow_mc.slides_mc.getNextHighestDepth
());
}
slideShow_mc.slides_mc["holder4"].loadMovie(this["image0u
ri"],slideShow_mc.slides_mc.getNextHighestDepth());
// function for the Next button
function nextMenuItem(eventObj:Object) {
slideShow_mc.gotoAndPlay("slide"+(currImage));
if ((currImage+1)>=totalImages) {
currImage = 0;
} else {
currImage++;
}
menu_mc.title_txt.text =
this._parent["image"+currImage+"title"];
menu_mc.description_txt.text =
this._parent["image"+currImage+"desc"];
}
// add the event listener for the button
next_btn.addEventListener("click", nextMenuItem);
“Review the ActionScript code” on page 127 explains this code
in detail.
4. Save your document.
5. Select Control > Test Movie.
6. In the Test Movie window, click Next to watch the animated images of
food and see the titles and descriptions update for each slide.
7. Close the Test Movie window.
Review the ActionScript code
This section explains what the ActionScript you just added to the Actions
panel is doing. If you prefer, you can skip this section and move on to
publishing your document for display in a web browser.
Complete information about working with ActionScript can be found in
Learning ActionScript 2.0 in Flash.
000_Getting_Started.book Page 127 Friday, September 2, 2005 12:22 PM

Table of Contents

Related product manuals