Response: Function Call Issue
Quote:
Originally Posted by
swak
2 things. 1) you can wrap your code using a [code] tag. Or at least use the quote button. 2) Could you post the fla? That would help with identifying things.
Thanks for responding. I figured out the issue. As for posting the fla, the file is extremely large. The issue was apparently with the the btnEnterpriseBackI. If the playhead is moved to this frame, it will not be recognized. However, by keeping the playhead on the btnEnterpriseFrameBackBtnA (active state) both buttons call their functions and work properly.
Code:
// ---Define the control variable
var rvarCUSelBtnFrm = 1; / variable for tracking and executing the Back/Next buttons in Canon pages.
// ---Define the function to advance the frame of the external .swf
function eorNextButton() { // Define the function
_root.mcMovieBase.mcbEnterpriseFrameNextBtn.btnEnt erpriseFrameNextBtnA.onRelease = function() { //Set the button press
if (_root.rvarCUSelBtnFrm>7) { // Test if the control variable is greater than the number of frames
_root.mcMovieBase.mcbEnterpriseFrameNextBtn.gotoAn dStop("inactive"); //If so, advance the playhead of the "Next" button timeline to the "inactive" frame label
} else if (_root.rvarCUSelBtnFrm<8) { //If the control variable is less than the number of frames
_root.rvarCUSelBtnFrm = _root.rvarCUSelBtnFrm+1; //Add 1 to the control variable
_root.container.mcMovieBaseEnterpriseOfficer.nextF rame(); //Advance the playhead to the next frame of the external .swf
if (_root.rvarCUSelBtnFrm>1) { // Test if the control variable is greater than 1
_root.mcMovieBase.mcbEnterpriseFrameBackBtn.gotoAn dStop("active"); // If so, move the playhead of the "Back" button timeline to the "active" frame label
}
}
}
// ---Define the function to retard the frame of the external .swf
function eorBackButton() { // Define the function
_root.mcMovieBase.mcbEnterpriseFrameBackBtn.btnEnt erpriseFrameBackBtnA.onRelease = function() { //Set the button press
if (_root.rvarCUSelBtnFrm<2) { // Test if the control value is less than 2
_root.mcMovieBase.mcbEnterpriseFrameBackBtn.gotoAn dStop("inactive"); //if so, move the playhead of the "Back button to the "inactive" timeline frame label
} else if (_root.rvarCUSelBtnFrm>1) { // Test if the control value is greater than 1
_root.rvarCUSelBtnFrm = _root.rvarCUSelBtnFrm-1; // If so, subtract 1 from the control variable
_root.container.mcMovieBaseEnterpriseOfficer.nextF rame(); // Retard the playhead to the previous frame of the external .swf
if (_root.rvarCUSelBtnFrm<8) { // Test if the control variable is less than the number of frames in the external .swf
_root.mcMovieBase.mcbEnterpriseFrameNextBtn.gotoAn dStop("active"); // If so, move the playhead of the "Next" button timeline to the "active" frame label
}
}
}
}