Copy link to clipboard
Copied
Hello!
My head is spinning trying to figure out this TypeError which comes up when 2 (seniors, artistic) of my 3 active sub-buttons is clicked, but not the 3rd (commercial).
TypeError: Error #1010: A term is undefined and has no properties.
at TNTstudios_fla::pageSeniors_54/frame1()
at flash.display::MovieClip/gotoAndStop()
at TNTstudios_fla::MainTimeline/seniorsPg()
Also, been looking for AS3 for mouse movement scrolling (my thumb panel includes a mask), but seem to find only as2.
If someone could help I would greatly appreciate! I am new to AS3 so forgive my scripting. Probably longer than should be.
Thanks!
Main timeline script
//Main button functions
home_btn.addEventListener(MouseEvent.CLICK, homePage);
pricing_btn.addEventListener(MouseEvent.CLICK, pricingPage);
about_btn.addEventListener(MouseEvent.CLICK, aboutPage);
gallery_btn.addEventListener(MouseEvent.CLICK, galleryPage);
contact_btn.addEventListener(MouseEvent.CLICK, contactPage);
function homePage(e:MouseEvent):void
{
content_mc.gotoAndPlay("home");
portfolioSub_mc.seniors_btn.enabled = false;
portfolioSub_mc.portraits_btn.enabled = false;
portfolioSub_mc.model_btn.enabled = false;
portfolioSub_mc.groups_btn.enabled = false;
portfolioSub_mc.commercial_btn.enabled = false;
portfolioSub_mc.artistic_btn.enabled = false;
}
function pricingPage(e:MouseEvent):void
{
content_mc.gotoAndPlay("pricing");
portfolioSub_mc.seniors_btn.enabled = false;
portfolioSub_mc.portraits_btn.enabled = false;
portfolioSub_mc.model_btn.enabled = false;
portfolioSub_mc.groups_btn.enabled = false;
portfolioSub_mc.commercial_btn.enabled = false;
portfolioSub_mc.artistic_btn.enabled = false;
}
function aboutPage(e:MouseEvent):void
{
content_mc.gotoAndPlay("about");
portfolioSub_mc.seniors_btn.enabled = false;
portfolioSub_mc.portraits_btn.enabled = false;
portfolioSub_mc.model_btn.enabled = false;
portfolioSub_mc.groups_btn.enabled = false;
portfolioSub_mc.commercial_btn.enabled = false;
portfolioSub_mc.artistic_btn.enabled = false;
}
function galleryPage(e:MouseEvent):void
{
content_mc.gotoAndPlay("gallery");
portfolioSub_mc.seniors_btn.enabled = false;
portfolioSub_mc.portraits_btn.enabled = false;
portfolioSub_mc.model_btn.enabled = false;
portfolioSub_mc.groups_btn.enabled = false;
portfolioSub_mc.commercial_btn.enabled = false;
portfolioSub_mc.artistic_btn.enabled = false;
}
function contactPage(e:MouseEvent):void
{
content_mc.gotoAndPlay("contact");
portfolioSub_mc.seniors_btn.enabled = false;
portfolioSub_mc.portraits_btn.enabled = false;
portfolioSub_mc.model_btn.enabled = false;
portfolioSub_mc.groups_btn.enabled = false;
portfolioSub_mc.commercial_btn.enabled = false;
portfolioSub_mc.artistic_btn.enabled = false;
}
//Submenu on with portfolio_btn rollover, off with all other button roll over.
portfolio_btn.addEventListener(MouseEvent.ROLL_OVER,subMenuOn);
content_mc.home_mc.addEventListener(MouseEvent.ROLL_OVER, subMenuOff);
content_mc.price_mc.addEventListener(MouseEvent.ROLL_OVER, subMenuOff);
content_mc.contact_mc.addEventListener(MouseEvent.ROLL_OVER, subMenuOff);
this.home_btn.addEventListener(MouseEvent.ROLL_OVER,subMenuOff);
this.pricing_btn.addEventListener(MouseEvent.ROLL_OVER,subMenuOff);
this.about_btn.addEventListener(MouseEvent.ROLL_OVER,subMenuOff);
this.gallery_btn.addEventListener(MouseEvent.ROLL_OVER,subMenuOff);
this.contact_btn.addEventListener(MouseEvent.ROLL_OVER,subMenuOff);
//portfolio_btn rollover event
function subMenuOn(e:MouseEvent):void
{
portfolioSub_mc.alpha = 1;
portfolioSub_mc.seniors_btn.enabled = true;
portfolioSub_mc.portraits_btn.enabled = true;
portfolioSub_mc.model_btn.enabled = true;
portfolioSub_mc.groups_btn.enabled = true;
portfolioSub_mc.commercial_btn.enabled = true;
portfolioSub_mc.artistic_btn.enabled = true;
}
//portfolio_btn rollout events
function subMenuOff(e:MouseEvent):void
{
portfolioSub_mc.alpha = 0;
portfolioSub_mc.seniors_btn.enabled = false;
portfolioSub_mc.portraits_btn.enabled = false;
portfolioSub_mc.model_btn.enabled = false;
portfolioSub_mc.groups_btn.enabled = false;
portfolioSub_mc.commercial_btn.enabled = false;
portfolioSub_mc.artistic_btn.enabled = false;
}
//Portfolio sub_button menu functions
portfolioSub_mc.seniors_btn.addEventListener(MouseEvent.CLICK, seniorsPg);
function seniorsPg(e:MouseEvent):void
{
content_mc.gotoAndStop("seniors");
}
portfolioSub_mc.commercial_btn.addEventListener(MouseEvent.CLICK, commPg);
function commPg(e:MouseEvent):void
{
content_mc.gotoAndStop("commercial");
}
portfolioSub_mc.artistic_btn.addEventListener(MouseEvent.CLICK, artPg);
function artPg(e:MouseEvent):void
{
content_mc.gotoAndStop("artistic");
}
seniorPage (accessed from submenu button) script
thmbSen_mc.thmb1_btn.addEventListener(MouseEvent.CLICK, pic1);
thmbSen_mc.thmb2_btn.addEventListener(MouseEvent.CLICK, pic2);
thmbSen_mc.thmb3_btn.addEventListener(MouseEvent.CLICK, pic3);
thmbSen_mc.thmb4_btn.addEventListener(MouseEvent.CLICK, pic4);
thmbSen_mc.thmb5_btn.addEventListener(MouseEvent.CLICK, pic5);
thmbSen_mc.thmb6_btn.addEventListener(MouseEvent.CLICK, pic6);
thmbSen_mc.thmb7_btn.addEventListener(MouseEvent.CLICK, pic7);
thmbSen_mc.thmb8_btn.addEventListener(MouseEvent.CLICK, pic8);
thmbSen_mc.thmb9_btn.addEventListener(MouseEvent.CLICK, pic9);
thmbSen_mc.thmb10_btn.addEventListener(MouseEvent.CLICK, pic10);
function pic1(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic1");
}
function pic2(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic2");
}
function pic3(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic3");
}
function pic4(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic4");
}
function pic5(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic5");
}
function pic6(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic6");
}
function pic7(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic7");
}
function pic8(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic8");
}
function pic9(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic9");
}
function pic10(e:MouseEvent):void
{
picSen_mc.gotoAndPlay("pic10");
}
Copy link to clipboard
Copied
Additional info: my thumbnail movie clip is on submenu pages(movie clips) within a content_mc.
Thanks!
Copy link to clipboard
Copied
click file/publish settings/flash and tick "permit debugging". retest.
the line number that contains the error will be in the error message. if you still need help beyond that, copy and paste the line of code referenced in the error message.
Copy link to clipboard
Copied
Thanks kglad,
That did help. Here is the code that came up:
TypeError: Error #1010: A term is undefined and has no properties.
at TNTstudios_fla::pageSeniors_54/frame1()[TNTstudios_fla.pageSeniors_54::frame1:10]
at flash.display::MovieClip/gotoAndStop()
at TNTstudios_fla::MainTimeline/seniorsPg()[TNTstudios_fla.MainTimeline::frame1:97]
{
picSen_mc.gotoAndPlay("pic10");
Copy link to clipboard
Copied
probably because there's no thmbSen_mc.thmb10_btn. if you have 10 buttons, are they named:
thmbSen_mc.thmb0_btn,thmbSen_mc.thmb1_btn,...,thmbSen_mc.thmb9_btn
Copy link to clipboard
Copied
Sorry for wasting your time on the last reply. I discovered the problem. It was stupidity on my part. I went back & checked my thumb_btn's & number 10 didn't have an instance name.
I could still use help on the mouse movement scroll though. I am trying to get my thumb buttons to scroll vertically on mouse move (top of panel, bottom of panel)
Thanks for your help!
Copy link to clipboard
Copied
you're welcome.
please mark this thread as answered, if you are able.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more