Flash 在Action Script 2.0中附加了带有“下一步/前进”按钮的电影控件
我使用attachMovie在舞台上连续调用电影剪辑。我用一个“前进”按钮在前进中滑动它们,但当我想以相同的顺序返回时,一切都会变得一团糟。 你可以看到swf在这里演奏 我对每一帧都进行了编号,这样你们就可以看到当点击“后退”按钮时,画面变得一团糟Flash 在Action Script 2.0中附加了带有“下一步/前进”按钮的电影控件,flash,actionscript-2,Flash,Actionscript 2,我使用attachMovie在舞台上连续调用电影剪辑。我用一个“前进”按钮在前进中滑动它们,但当我想以相同的顺序返回时,一切都会变得一团糟。 你可以看到swf在这里演奏 我对每一帧都进行了编号,这样你们就可以看到当点击“后退”按钮时,画面变得一团糟 // Each of the button functions here call the add_page() function and // pass the Identifier of the page that they will dis
// Each of the button functions here call the add_page() function and
// pass the Identifier of the page that they will display
b_0.onRelease = function() {
next_page( "Video1A_" + page_count);
};
b_1.onRelease = function() {
prev_page( "Video1A_" + page_count);
};
// This function manages the page clips that are attached to content_mc.
// The variable page_count is used to make sure that each page gets a unique
// name and depth. It also gives us a way to get the instance name of the
// last page clip that was created.
var page_count = 1;
// The add_page() function takes the Linkage identifier of the new page to be
// created as a parameter.
function next_page( next_page ) {
// Make the name of the last page attached
var old_page = content_mc[ "Video1A_" + page_count ];
// If that page exists remove it by sliding off out of the visible area.
if ( old_page != undefined ) {
old_page.slideTo( '-600', '0', 1, '', 0, old_page + '.removeMovieClip()' );
}
// Up page count by 1
page_count ++;
// Attach the new page to content_mc
var new_page = content_mc.attachMovie( next_page, "Video1A_" + page_count, page_count );
// Position the new page below the visible area
new_page._x = 600;
// slide the new page into the visible area.
new_page.slideTo( '-600', 0, 2 );
}
// The add_page() function takes the Linkage identifier of the new page to be
// created as a parameter.
function prev_page( next_page ) {
// Make the name of the last page attached
var old_page = content_mc[ "Video1A_" + page_count ];
// If that page exists remove it by sliding off out of the visible area.
if ( old_page != undefined ) {
old_page.slideTo( '600', '0', 2, '', 0, old_page + '.removeMovieClip()' );
}
// Up page count by 1
page_count --;
// Attach the new page to content_mc
var new_page = content_mc.attachMovie( next_page, "Video1A_" + page_count, page_count );
// Position the new page below the visible area
new_page._x = -600;
// slide the new page into the visible area.
new_page.slideTo( '600', 0, 2 );
}
粗体部分错误,所附加的电影剪辑是从中传递的下一个_页参数
prev_page( "Video1A_" + page_count);
如果要使page_计数成为一个全局变量,并且有单独的函数用于转到下一页和转到上一页,为什么还要在函数中使用参数
prev_page( "Video1A_" + page_count);