getFrame function
i've been working on tutorial teach myself basics of building flash websites. unfortunately, i've run problem , tutorial's author apparently not taking questions more. don't want scrap whole thing, because i've put lot of time it. if me figure out problem i'd super grateful.
basically have menu centered on home page flies top right corner when on other page. when try click on navigation go of other pages, error:
typeerror: error #1006: getframe not function.
@ portfoliosite2012_fla::maintimeline/navigationclicked()
if getframe isn't function, why work tutorial's author in source files allows download? i'd love explanation along answer, if that's possible, can understand , learn this.
here's link tutorial if want see http://www.webdesigndev.com/flash/creating-a-flash-portfolio-website/comment-page-2#commen ts. except working in cs5, not cs3.
and here's code 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 store frame label's name.
var frmlabel:string = '';
//determine frame label use based on
//button 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 frame number based on our frame label.
var frmgoto:number = this.getframe(frmlabel);
//don't if on requested page.
if (currentframe != frmgoto)
{
//get , remember home page's frame number.
var frmhome:number = this.getframe("home_frm");
//if our requested page home page, flying menu
//needs go home.
if(frmgoto == frmhome)
{
mainmenu_mc.gohome();
}
//else, if on home page , leaving, then
//leave home.
else if(currentframe == frmhome)
{
mainmenu_mc.leavehome();
}
//go requested page.
gotoandplay(frmgoto);
}
}
thanks help!
for show, appear missing bit of code main timeline of fla file, includes getframe function code looking for. try looking @ source file provided downloaded - function not hard find.
More discussions in ActionScript 3
adobe
Comments
Post a Comment