getFrame function
I've been working on a tutorial to teach myself the basics of building Flash websites. Unfortunately, I've run into a problem and the tutorial's author is apparently not taking questions any more. I don't want to just scrap the whole thing, because I've put a lot of time into it. So if anyone could help me figure out the problem I'd be super grateful.
Basically I have a menu that is centered on the home page but flies to the top right corner when on any other page. But when I try to click on the navigation to go to any of the other pages, I get this error:
TypeError: Error #1006: getFrame is not a function.
at PortfolioSite2012_fla::MainTimeline/navigationClicked()
If getFrame isn't a function, then why does it work for the tutorial's author in the source files that he allows you to download? I'd love an explanation along with the answer, if that's possible, so I can understand and learn from this.
Here's the link to the tutorial if you want to see it http://www.webdesigndev.com/flash/creating-a-flash-portfolio-website/comment-page-2#comments. Except I am working in CS5, not CS3.
And here's my code for the website.
/////////////////////////////////////////////////////////////////////
// Startup.
/////////////////////////////////////////////////////////////////////
stop();
mainMenu_mc.stop();
/////////////////////////////////////////////////////////////////////
// Event Setup.
/////////////////////////////////////////////////////////////////////
backward_btn.addEventListener(MouseEvent.CLICK, navigationClicked)
forward_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
logo_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
home_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.profile_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.resume_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.contact_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.portfolio_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.photography_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
/////////////////////////////////////////////////////////////////////
// Event Handlers.
/////////////////////////////////////////////////////////////////////
function navigationClicked(Event:MouseEvent):void
{
//We'll use this to store the Frame Label's name.
var frmLabel:String = '';
//Determine what Frame Label to use based on which
//button was clicked.
switch (Event.target)
{
case backward_btn :
frmLabel = this.getSequencedFrame(false);
break;
case forward_btn :
frmLabel = this.getSequencedFrame(true);
break;
case logo_btn :
frmLabel = "home_frm";
break;
case home_btn :
frmLabel = "home_frm";
break;
case mainMenu_mc.profile_btn :
frmLabel = "profile_frm";
break;
case mainMenu_mc.resume_btn :
frmLabel = "resume_frm";
break;
case mainMenu_mc.contact_btn :
frmLabel = "contact_frm";
break;
case mainMenu_mc.portfolio_btn :
frmLabel = "portfolio_frm";
break;
case mainMenu_mc.photography_btn :
frmLabel = "photography_frm";
break;
}
//Find the frame number based on our Frame Label.
var frmGoto:Number = this.getFrame(frmLabel);
//Don't do anything if we are already on the requested page.
if (currentFrame != frmGoto)
{
//Get and remember the Home page's frame number.
var frmHome:Number = this.getFrame("home_frm");
//If our requested page is the Home page, the flying menu
//needs to go home.
if(frmGoto == frmHome)
{
mainMenu_mc.goHome();
}
//Else, if we are on the Home page and are leaving, then
//leave home.
else if(currentFrame == frmHome)
{
mainMenu_mc.leaveHome();
}
//Go to the requested page.
gotoAndPlay(frmGoto);
}
}
Thanks so much for any help!
