Copy link to clipboard
Copied
Hello all,
I have a drop down menu with 7 options. The menu is a movie clip with a mask that reveals each of the buttons when a person mouse_overs the menu button. Each menu option does the same thing, it will call a function based on the button clicked. The function for each button does the same thing:
function INDEX_Safety (e:MouseEvent):void
{
play();
INDEX_SAFETY=true;
Sound_Stopper ();
}
Each of the functions will change the value of its respecive boolean variable. One for each button. Sound Stopper is a function that stops any FLV Sound that is currently playing.
When it goes through play() it will come to a particular frame that has:
Index_Jumper ();
this function determines which boolean has been set to true, and does a gotoAndPlay("Label Name") based on the boolean that has been set to true. Then sets the boolean back to false.
function Index_Jumper ():void
{
if (INDEX_SAFETY==true){gotoAndPlay("Safety"); INDEX_SAFETY=false;}
if (INDEX_TOOLS==true){gotoAndPlay("Tools and Positions"); INDEX_TOOLS=false;}
if (INDEX_METHODS==true){gotoAndPlay("The Methods"); INDEX_METHODS=false;}
if (INDEX_METHOD1==true){gotoAndPlay("Method 1"); INDEX_METHOD1=false;}
if (INDEX_METHOD2==true){gotoAndPlay("Method 2"); INDEX_METHOD2=false;}
if (INDEX_TDBL==true){gotoAndPlay("Installing TDBL"); INDEX_TDBL=false;}
if (INDEX_RAISING==true){gotoAndPlay("Raising the Stand"); INDEX_RAISING=false;}
}
The issue i am having: When i click on the 6th option, TDBL, i get the error:
TypeError: Error #1010: A term is undefined and has no properties.
at RaisingtheOperatorsPlatform_fla::MainTimeline/frame147()[RaisingtheOperatorsPlatform_fla.MainTimeline::frame147:10]
It says frame 147:10
From my understanding this means the 10th line on Frame 147.
This is my frame 147:
1. stop ();
2. Caption ();
3. IndexMC.Safety_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Safety);
4. IndexMC.Tools_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tools);
5. IndexMC.Methods_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Methods);
6. IndexMC.Method1_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method1);
7. IndexMC.Method2_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method2);
8. IndexMC.TBDL_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tdbl);
9. IndexMC.Raising_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Raising);
I dont have a 10th line.
also, when i click the 7th option, nothing happens. However, options 1 - 5 on the drop down menu work just fine.
Thanks for any insight.
Right after posting that, I got an idea to try adding the following to frame 1:
addEventListener(Event.ENTER_FRAME, Frame_147);
function Frame_147 (event:Event):void
{
if (currentFrame==147)
{
stop ();
Caption ();
IndexMC.Safety_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Safety);
IndexMC.Tools_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tools);
IndexMC.Methods_Menu_Button.addEventListener(MouseEvent.CLICK, I
...Copy link to clipboard
Copied
flash thinks you have a 10th line on frame 147. to find that frame/line:
if you're using scenes, frame numbering starts with the first frame in the first scene. it continues with the first frame in the 2nd scene being added to the frame number of the last frame in the 1st scene etc.
line numbers start with the first line of code in the top-most layer. line numbering continues in the next layer with code having its first line number added to the last line of code in the top-most layer etc.
so, what code in line 10, frame 147.
Copy link to clipboard
Copied
that is one of the issues. There is no line 10. I literally only have 9 lines of code in frame 147. I am also only using 1 scene. I dont even have a blank line 10.
Copy link to clipboard
Copied
attach a screenshot showing all your layers at frame 147.
Copy link to clipboard
Copied
Right after posting that, I got an idea to try adding the following to frame 1:
addEventListener(Event.ENTER_FRAME, Frame_147);
function Frame_147 (event:Event):void
{
if (currentFrame==147)
{
stop ();
Caption ();
IndexMC.Safety_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Safety);
IndexMC.Tools_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tools);
IndexMC.Methods_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Methods);
IndexMC.Method1_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method1);
IndexMC.Method2_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method2);
IndexMC.TDBL_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tdbl);
IndexMC.Raising_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Raising);
}
}
I then commented-out frame 147.
the error i got pointed to line 36 of frame 1, which is:
IndexMC.TDBL_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tdbl);
Being able to focus on this, i see that i have IndexMC.TBDL instead of IndexMC.TDBL, i think this was one of those "been looking at this thing for too long" errors. Thank you for looking into this, the problem is now solved. As for the error pointing to a line that doesn't exist:
I still have no idea why it would say the issue was frame 147:10
Copy link to clipboard
Copied
if you're still using that frame 1 code, change it to:
addEventListener(Event.ENTER_FRAME, Frame_147);
function Frame_147 (event:Event):void
{
if (currentFrame==147)
{
removeEventListener(Event.ENTER_FRAME,Frame_147);
stop ();
Caption ();
IndexMC.Safety_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Safety);
IndexMC.Tools_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tools);
IndexMC.Methods_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Methods);
IndexMC.Method1_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method1);
IndexMC.Method2_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method2);
IndexMC.TDBL_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tdbl);
IndexMC.Raising_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Raising);
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now