Skip to main content
gabagool
Participant
May 27, 2026 6:43 PM UTC
Question

why doesn't my code work error 1010

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()
 

    8 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    Jun 5, 2026 3:00 PM UTC

    Hi.

     

    Yeah, I think the issue here is that you're trying to write HTM5 Canvas document code in an AS3 document.

    Regards,

    JC

    Translate
    kglad
    Community Expert
    Community Expert
    Jun 6, 2026 1:53 PM UTC

    there has to be more than just a document issue.  ie, there’s no “ball” object when the code executes.

     

    otherwise, there would be a function (“on”) error

    Translate
    JoãoCésar17023019
    Community Expert
    Community Expert
    Jun 6, 2026 4:45 PM UTC

    Both actually.

     

    Because HTML5 Canvas documents don't compile published content and thus don't throw compiler errors.

     

    So the OP probably is using an AS3 document and don't have an instance on stage called ball.

    Translate
    Joseph Labrecque
    Community Expert
    Community Expert
    May 28, 2026 7:59 PM UTC

    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. 

    Translate
    tasogare_95
    Community Expert
    Community Expert
    May 28, 2026 12:14 PM UTC

    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.

    Translate
    kglad
    Community Expert
    Community Expert
    May 27, 2026 7:25 PM UTC

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

    Translate
    gabagool
    gabagoolAuthor
    Participant
    May 27, 2026 7:26 PM UTC

    no compiler errors showed up

    Translate
    i punch babies
    kglad
    Community Expert
    Community Expert
    May 28, 2026 12:56 PM UTC

    ​@gabagool 

     

    what document type are you creatings?  canvas or as3?

    Translate