Skip to main content
gabagool
Participant
May 27, 2026
Question

why doesn't my code work error 1010

  • May 27, 2026
  • 3 replies
  • 23 views

code
this.ball.on("pressmove", moveBall );

function moveBall(e) {
    
        e.currentTarget.x=e.stageX;
        e.currentTarget.y=e.stageY;
}        

 

 

error

TypeError: Error #1010: A term is undefined and has no properties.
    at houseinside_Scene4_fla::MainTimeline/frame1()
 

    3 replies

    Joseph Labrecque
    Community Expert
    Community Expert
    May 28, 2026

    If defining ‘ball’ on the timeline and not in code - be sure to have it on stage and available before any code actually is executed. For instance - have a frame after the frame where ball is defined that you write the code on, invoking it… also - be sure your ‘ball’ object remains on frame when the code executes. 

    tasogare_95
    Community Expert
    Community Expert
    May 28, 2026

    Error #1010 usually means that something is undefined at runtime.

    In this case, this.ball is probably undefined when the code runs. Please check that the object on the stage has the instance name "ball", not just the library symbol name.

    Also, this code looks like HTML5 Canvas / CreateJS code, but the error message looks like an ActionScript 3.0 error.
    Are you using HTML5 Canvas or ActionScript 3.0?
    If your document is an ActionScript 3.0 FLA, this.ball.on("pressmove", ...) will not work. You need to use addEventListener with MouseEvent instead.

    kglad
    Community Expert
    Community Expert
    May 27, 2026

    this.ball must be the problem (if that’s the problematic code(.

    gabagool
    gabagoolAuthor
    Participant
    May 27, 2026

    no compiler errors showed up

    i punch babies
    kglad
    Community Expert
    Community Expert
    May 28, 2026

    @gabagool 

     

    what document type are you creatings?  canvas or as3?