Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:15:53+00:00 2026-06-17T17:15:53+00:00

I am coding a flash game in which the ball hits a movie clip

  • 0

I am coding a flash game in which the ball hits a movie clip object and this takes the user to a new scene.
I have 3 main methods:
movePaddle, moveBall and changeFrame.

it works fine but when i execute the changeFrame method (ball hits movie clip)to go to a new frame i get a whole page of 1009 errors:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at FlashGameNEW_fla::MainTimeline/changeFrame()

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at FlashGameNEW_fla::MainTimeline/movePaddle()

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at FlashGameNEW_fla::MainTimeline/moveBall()

This is repeated many times.

Any help would be greatly appreciated.
Thanks.

EDIT: with code below

function beginCode():void{

mcPaddle.addEventListener(Event.ENTER_FRAME, movePaddle);
mcBall.addEventListener(Event.ENTER_FRAME, moveBall);
mcBall.addEventListener(Event.ENTER_FRAME, changeFrame);
}

function movePaddle(event:Event):void{

mcPaddle.x = mouseX - mcPaddle.width / 2;

if(mouseX < mcPaddle.width / 2){
    //Keep the paddle on stage
    mcPaddle.x = 0;
}

if(mouseX > stage.stageWidth - mcPaddle.width / 2){

    mcPaddle.x = stage.stageWidth - mcPaddle.width;
}
}

function changeFrame(event:Event):void{
if (mcBall.hitTestObject(Northcote)) {  
    this.gotoAndPlay(3);  
              }
              
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:15:54+00:00Added an answer on June 17, 2026 at 5:15 pm

    The problem is you havent instances of mcPaddle and mcBall in frame 3 (For instance, they are not created right now and will be created later). Do check for existing instance:

    function movePaddle(event:Event):void {    
        if (!mcPaddle)
            return;
    
        mcPaddle.x = mouseX - mcPaddle.width / 2;
    
        if(mouseX < mcPaddle.width / 2){
            //Keep the paddle on stage
            mcPaddle.x = 0;
        }
    
        if(mouseX > stage.stageWidth - mcPaddle.width / 2) {    
            mcPaddle.x = stage.stageWidth - mcPaddle.width;
        }
    }
    
    function changeFrame(event:Event):void{
        if (mcBall && Northcote && mcBall.hitTestObject(Northcote)) {  
            this.gotoAndPlay(3);  
        }    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently begun to develop a game in Haxe which targets the Flash
I'm currently coding counter system and have spotted one problem with flash banners without
I wrote a small game a while back in Flash that I'm now re-coding
The following hidden Flash movie is appearing on pages I am coding; until I
I'm coding a simple Flash game, just to learn flash and improve my maths,
I have a question about Flash. I am writing my first browser game, and
I have a Flash game I made way back in 2008. It runs super
I am coding a flash game using AS3 where the player begins with 3
I have an ugly druple-gardens RSS feed coming into flash and I'm using the
Coding Platform ASP.NET 4.0 WebForms on IIS7.5 If I request a page blahblah.aspx which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.