Macromedia studio 8-exploring studio 8 Manual De Usuario
246 Tutorial: Building Your First Flash Application
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"
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) {
function nextMenuItem(eventObj:Object) {
slideShow_mc.gotoAndPlay("slide"+(currImage));
if ((currImage+1)>=totalImages) {
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"];
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);
next_btn.addEventListener("click", nextMenuItem);
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.
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.
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.
Learning ActionScript 2.0 in Flash.
000_ExploringStudio.book Page 246 Tuesday, August 30, 2005 9:30 AM