May I know why I need to add "ComputeBtn.addEventListener(MouseEvent.CLICK,computeLoan)" at the function returnToInput again, else the button ComputeBtn at frame 1 will not work again. I haven't remove the listener. Just goto the second frame to show the result and go back to first frame for enter the data.
package {
import flash.display.*;
import flash.events.*;
//THE CLASS DEFINITION
public class carApp extends MovieClip {
function carApp() {
gotoAndStop(1);
ComputeBtn.addEventListener(MouseEvent.CLICK,computeLoan);
}
function computeLoan(event:MouseEvent) {
gotoAndStop(2);
trace("Show result");
StartAgainBtn.addEventListener(MouseEvent.CLICK,returnToInput);
}
function returnToInput(event:MouseEvent) {
gotoAndStop(1);
ComputeBtn.addEventListener(MouseEvent.CLICK,computeLoan);
}
}
}