Scrolling mc by entering frame?

[color=#000087]hi there…[/color]

i have a site i’m working on where i currently have the stage scroll left or right when a button is pressed. each button has an instance name, and the stage is an mc with the following code:


onClipEvent[/color] ([color=#000087]load[/color]) {
[color=#000087]_x[/color] = 0;
[color=#000087]_y[/color] = 0;
div = 5;
}[color=#000087]onClipEvent[/color] (enterFrame) {
[color=#000087]_x[/color] += (endX-[color=#000087]_x[/color])/div;
[color=#000087]_y[/color] += (endY-[color=#000087]_y[/color])/div;
[color=#000087]_root[/color].home.[color=#000087]onRelease[/color] = [color=#000087]function[/color]() {
endX = 0;
endY = 0;
[color=#000087]_root[/color].music.[color=#000087]onRelease[/color] = [color=#000087]function[/color](){
endX = -300;
endY = 0;
}; [color=#000087]_root[/color].biography.[color=#000087]onRelease[/color] = [color=#000087]function[/color]() {
endX = -600;
endY = 0;

this works great, but now i need to change this so that the scrolling starts when another mc reaches a frame, instead of when a button is pressed.

so like, when the “biography” button is pressed, rather then scroll the stage, it’s now going to tell a mc on the stage to play an exit animation. when that animation ends, i need the last frame to tell the stage to scroll to the desired destination. hopefully that makes sense.

i’m having a hard time figuring out the syntax to transfer my onrelease function to an onenterframe function. any help would be most appreciated! :thumb: