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 9137439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:06:13+00:00 2026-06-17T09:06:13+00:00

I have been trying to fix the above error since yesterday late into the

  • 0

I have been trying to fix the above error since yesterday late into the night.
Today i tried again for many hours. I learned a great deal and understand a lot more. I found some things along the way and fixed them, unfortunatly the error persisted.

I now know for example
that the above error indicates that one of the objects being targeted by my code is out of scope.

Caused possibly by:

  1. It being declared but not instantiated

  2. It doesn’t have an instance name (or the instance name is misspelled)

  3. It does not exist in the frame where that code is trying to talk to it

  4. It is animated into place but is not assigned instance names in every keyframe for it

  5. It is one of two or more consecutive keyframes of the same objects with no name (or a different name) assigned in the preceding frame(s).

This is the error line where it goes wrong:

if (back.collisions.hitTestPoint(player.x + leftBumpPoint.x,player.y + leftBumpPoint.y,true))

So it has to be something with back or collosions…

  1. I checked and it’s not a misspeled instance
    BTW back is a background movieclip with Back instance and it contains the collisions image with instance Collisions

  2. it is being declared (but possibly not right)

  3. Could be the cause. frame 1 is the preloader. frame 2 is the menu with a button to start code cat.as. Frame 3 contains the game

  4. it only exists on one keyframe so it isn’t mistake number 4

  5. it only exists on one keyframe so it isn’t mistake number 5

So it’s most likely number 3.

What i think happens is that i click on the button and it immediatly wants to run cat.as before going to frame 3. How should i solve this. I’m thinking of placing the game on frame 2 but offscreen.
I would very much like feedback on this, please. Thanks

My code: EDIT: i gave the var public

package 
{
import flash.display.MovieClip;
import flash.events.*;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.geom.Point;

public class Cat extends MovieClip
{

    public var leftPressedfBoolean = false;
    public var rightPressed:Boolean = false;
    public var upPressed:Boolean = false;
    public var downPressed:Boolean = false;

    public var leftBumping:Boolean = false;
    public var rightBumping:Boolean = false;
    public var upBumping:Boolean = false;
    public var downBumping:Boolean = false;

    public var leftBumpPoint:Point = new Point(-30,-55);
    public var rightBumpPoint:Point = new Point(30,-55);
    public var upBumpPoint:Point = new Point(0,-120);
    public var downBumpPoint:Point = new Point(0,0);

    public var scrollX:Number = 0;
    public var scrollY:Number = 500;

    public var xSpeed:Number = 0;
    public var ySpeed:Number = 0;

    public var speedConstant:Number = 4;
    public var frictionConstant:Number = 0.9;
    public var gravityConstant:Number = 1.8;
    public var jumpConstant:Number = -35;
    public var maxSpeedConstant:Number = 18;

    public var doubleJumpReady:Boolean = false;
    public var upReleasedInAir:Boolean = false;

    public var keyCollected:Boolean = false;
    public var doorOpen:Boolean = false;

    public var currentLevel:int = 1;

    public var animationState:String = "idle";

    public var bulletList:Array = new Array();
    public var enemyList:Array = new Array();
    public var bumperList:Array = new Array();

    public var player:Player;
    public var back:Back;
    public var sky:Sky;
    public var collisions:Collisions;
    public var visuals:Visuals;
    public var other:Other;
    public var doorKey:DoorKey;

    public function Cat()
    {
        addEventListener(Event.ADDED_TO_STAGE, init);
    }

    public function init(e:Event):void

{
        player = new Player();
        back = new Back();
        sky = new Sky();
        visuals = new Visuals();
        other = new Other();            
        collisions = new Collisions();
        doorKey = new DoorKey();

        stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
        stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
        stage.addEventListener(Event.ENTER_FRAME, loop);
        addEnemiesToLevel1();
        addBumpersToLevel1();
    }

    public function addEnemiesToLevel1():void
    {
        addEnemy(620, -115);
        addEnemy(900, -490);
        addEnemy(2005, -115);
        addEnemy(1225, -875);
    }

    public function addBumpersToLevel1():void
    {
        addBumper(500, -115);
        addBumper(740, -115);
    }


    public function loop(e:Event):void
    {
        if (back.collisions.hitTestPoint(player.x + leftBumpPoint.x,player.y + leftBumpPoint.y,true))
        {
            //trace("leftBumping");
            leftBumping = true;
        }
        else
        {
            leftBumping = false;
        }
  • 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-17T09:06:13+00:00Added an answer on June 17, 2026 at 9:06 am

    Add this before your if statement to see which item is missing:

    trace("back "+back);
    trace("back.collisions "+back.collisions);
    trace("player.x "+player.x);
    trace("leftBumpPoint.x "+leftBumpPoint.x);
    trace("player.y "+player.y);
    trace("leftBumpPoint.y "+leftBumpPoint.y);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have been trying to fix this for about two months. It all
I really need some help with this as I have been trying to fix
I am trying to fix a regular expression i have been using in php
I have been trying to fix/find a solution for an hour or so for
I have been trying to fix this issue for the past 2-3 hours but
I have been trying to fix this problem for hours. My app keeps crashing
So I have another problem that I am running into. I have been trying
I have been trying to fix this script for more than an hour and
I have been trying to fix this for a bit, and I must be
Ok so I have been trying to fix this for days, and I'm not

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.