Hi all,
newb here trying to get my first fully functional flash site up and running. I’ve gotten almost everything done but suddenly when I debug my FLA I get an error:
“TypeError: Error #1010: A term is undefined and has no properties.
at rightsideoptics_fla::MainTimeline/frame1()”
I haven’t deleted anything that I can tell, all of my MC’s and BTNs are in place. I have all my functions defined before I’m calling them. Any ideas on what I’m doing wrong? I’ve dug through all the forums I can find but this error seems very generic so it doesn’t help me diagnose my problem.
I’ve attached my FLA for anyone who thinks they can help me out. Thanks ahead of time! Also, below is my main actionscript for the site on my ACTIONS layer, in frame 1 (start_frm).
If there’s anything else you need to know please feel free to ask =)
/////////////////////////////////////////////////////////////////////
// Startup.
/////////////////////////////////////////////////////////////////////
stop();
mainMenu_mc.stop();
/////////////////////////////////////////////////////////////////////
// Event Setup.
/////////////////////////////////////////////////////////////////////
mainMenu_mc.bio_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.illustrations_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.sketchbook_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.photography_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.webdesign_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.print_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
mainMenu_mc.contact_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
logo_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
home_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
forward_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
backward_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 mainMenu_mc.bio_btn :
frmLabel = "bio_frm";
break;
case mainMenu_mc.illustration_btn :
frmLabel = "illustration_frm";
break;
case mainMenu_mc.sketchbook_btn :
frmLabel = "sketchbook_frm";
break;
case mainMenu_mc.photography_btn :
frmLabel = "photography_frm";
break;
case mainMenu_mc.webdesign_btn :
frmLabel = "web-design_frm";
break;
case mainMenu_mc.print_btn :
frmLabel = "print_frm";
break;
case mainMenu_mc.contact_btn :
frmLabel = "contact_frm";
break;
case logo_btn :
frmLabel = "home_frm";
break;
case home_btn :
frmLabel = "home_frm";
break;
case backward_btn :
frmLabel = this.getSequencedFrame(false);
break;
case forward_btn :
frmLabel = this.getSequencedFrame(true);
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);
}
/////////////////////////////////////////////////////////////////////
// Helper Functions.
/////////////////////////////////////////////////////////////////////
function getFrame(frameName:String):Number
{
var frame:Number = 1;
//Loop through all Frame Labels to find our requested frame.
for (var i = 0; i < currentLabels.length; i++)
{
if (currentLabels*.name == frameName)
{
frame = currentLabels*.frame;
break;
}
}
return frame;
}
function getFrameLabel(frame:Number):String
{
var frmLabel:String = '';
//Loop through all Frame Labels to find the requested Frame Label.
for (var i = 0; i < currentLabels.length; i++)
{
if (currentLabels*.frame == frame)
{
frmLabel = currentLabels*.name;
break;
}
}
return frmLabel;
}
function getSequencedFrame(forward:Boolean):String
{
//Used to remember the Frame Label of our page.
var frmSequence:String = '';
//If we're looking for the next page in sequence...
if(forward)
{
//If our current page is that last page...
if(currentFrame == this.getFrame("contact_frm"))
{
//...then, we need to go Home.
frmSequence = "home_frm";
}
else
{
//...else, we just need to go to the next frame.
frmSequence = this.getFrameLabel((currentFrame + 1));
}
}
//...else, we're looking for the previous page in sequence.
else
{
//If we're on the first page (remember, we skipped our Start page)...
if(currentFrame == this.getFrame("home_frm") ||
currentFrame == this.getFrame("start_frm"))
{
//...then, we need to go to the last page.
frmSequence = "contact_frm";
}
else
{
//...else, we just need to go to the the previous frame.
frmSequence = this.getFrameLabel((currentFrame - 1));
}
}
return frmSequence;
}
I’m sorry for the newb question, but its been 2 days and I don’t know where else to turn for help. Thanks a ton!