Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adobe Animate Error 1010

New Here ,
Sep 11, 2018 Sep 11, 2018

I'm very new to actionscript3 and am working on a project where I have a single scene and two buttons to progress through this scene. When I test the movie the buttons do not carry out my programmed functions but are recognized as being pressed. I'm receiving an error 1010 stating:

TypeError: Error #1010: A term is undefined and has no properties.

at Function/Sunrise/$construct/playTimeline1()

TypeError: Error #1010: A term is undefined and has no properties.

at Function/Sunrise/$construct/playTimeline2()

Here is my code:

package {

     import flash.display.MovieClip;

     import flash.events.MouseEvent;

     import flash.display.SimpleButton;

     public class Sunrise extends MovieClip{

          public function Sunrise() {

          // constructor code

               function playTimeline1(event:MouseEvent): void {

                    this.Car.gotoAndPlay(2);

                    this.Bird.gotoAndPlay(2);

                    this.Stars.gotoAndPlay(2);

                    this.Sunrise.gotoAndPlay(2);

                    this.Man.gotoAndPlay(2);

                    this.Sky.gotoAndPlay(2);

               }

               button1.addEventListener(MouseEvent.MOUSE_DOWN, playTimeline1);

               function playTimeline2(event:MouseEvent): void {

                    this.Car.gotoAndPlay(25);

                    this.Stars.gotoAndPlay(25);

                    this.Bird.gotoAndPlay(25);

                    this.Sunrise.gotoAndPlay(25);

                    this.Man.gotoAndPlay(25);

                    this.Sky.gotoAndPlay(25);

               }

               button2.addEventListener(MouseEvent.MOUSE_DOWN, playTimeline2);

          }

     }

}

Thank you for your time

TOPICS
ActionScript
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2018 Sep 11, 2018

click file>publish settings>swf and tick 'permit debugging'.  retest.

the problematic line of code referencing a non-existent object will be in the error message.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 12, 2018 Sep 12, 2018
LATEST

I see that you already have permit debugging. Look at lines 13 and 23 in the code, it's quite likely the same movieclip. Check the name of it in Properties to make sure it matches the name in the code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines