Skip to main content
Participant
March 29, 2017
Question

Error #1010 cant find the solution

  • March 29, 2017
  • 2 replies
  • 807 views

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?

This topic has been closed for replies.

2 replies

Participant
March 31, 2017

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

kglad
Community Expert
Community Expert
March 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