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

Error #1010 cant find the solution

New Here ,
Mar 29, 2017 Mar 29, 2017

im new at as3 and i keep getting this error

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

  at Untitled_2_fla::MainTimeline/frame1()[Untitled_2_fla.MainTimeline::frame1:4]

and i've search the net for more than a day for solution but i still cant get it

and here is my code

import flash.events.MouseEvent;

btnMc1.txtSourceMc.gotoAndStop();

btnMc1.addEventListener(MouseEvent.ROLL_OVER, over);

btnMc1.addEventListener(MouseEvent.ROLL_OUT, out);

function over(e: MouseEvent) {

  btnMc1.buttonMode = true;

  btnMc1.gotoAndPlay(1);

  }

function out(e: MouseEvent) {

  btnMc1.gotoAndPlay(62);

  }

can anybody help me solve it?

TOPICS
ActionScript
789
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 ,
Mar 29, 2017 Mar 29, 2017

if btnMc1.txtSourceMc.gotoAndStop(); is line 4,

btnMc1 or

btnMc1.txtSourceMc

doesn't exist when your code executes.

after you fix that you'll hit another error:  you need a frame number or label in your goto

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 Beginner ,
Mar 30, 2017 Mar 30, 2017
LATEST

I'm not really sure what the txtSourceMc is doing there. Is that a movie within another movie? If it is, the following two options would work for you.

btnMc1.txtSourceMc.gotoAndStop(1); // with a '1' or some other number

or this:

btnMc1.txtSourceMc.stop();

but judging from your code, I think you need this:

import flash.events.MouseEvent;

btnMc1.stop();

btnMc1.addEventListener(MouseEvent.ROLL_OVER, over);

btnMc1.addEventListener(MouseEvent.ROLL_OUT, out);

function over(e: MouseEvent) {

  btnMc1.buttonMode = true;

  btnMc1.gotoAndPlay(1);

}

function out(e: MouseEvent) {

  btnMc1.gotoAndPlay(62);

}

Good luck

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