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

  • Home
  • SEARCH
  • 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 4082264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:09:58+00:00 2026-05-20T18:09:58+00:00

ArgumentError: Error #1063: Argument count mismatch on scripts::GamePlay(). Expected 1, got 0. at flash.display::Sprite/constructChildren()

  • 0
ArgumentError: Error #1063: Argument count mismatch on scripts::GamePlay(). Expected 1, got 0.
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()

I have some of these errors when I compile and I know the solution.

public function GamePlay(stageRef:Stage)
        {
            this.stageRef = stageRef;
            player = new Player(stageRef);

            waitTimer.addEventListener(TimerEvent.TIMER_COMPLETE, WaitTimer, false, 0, true);
            waitTimer.start();

            player.addEventListener(Event.REMOVED_FROM_STAGE, PlayerRemoved, false, 0, true);
        }

In the constructor I must add stageRef:Stage = null this will solve the error, but if I do that all my timers think the stage is null or something is null, like so.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at scripts::GamePlay/WaitTimer()[C:\Users\Noodles\Documents\Flash Projects\BlockDrop\scripts\GamePlay.as:71]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.utils::Timer/tick()

What can I do to fix this error?

  • 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-05-20T18:09:59+00:00Added an answer on May 20, 2026 at 6:09 pm

    Are you creating this object in the constructor of your main application’s document class? If so, you’ll run into this issue even if the rest of your code is perfect because of the way Flash Player works.

    Basically, “Stage” is null until your main application is added to the stage. This is a quick shortcut to lots of unusual behavior and hard-to-trace bugs. A very common solution is to minimize the code in your document class’s constructor. Instead of putting your init logic in your constructor, your constructor just adds an event listener for Event.ADDED_TO_STAGE, and your logic goes into your handler. It would look something like this:

    protected var gamePlay:GamePlay;
    
    public function MyConstructor():void {
         this.addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
    }
    
    protected function addedHandler(e:Event):void {
         this.removeEventListener(Event.ADDED_TO_STAGE, addedHandler);
         gamePlay = new GamePlay(this.stage);
    }
    

    Let me know if that solves your problem, it’s possible I’m not entirely understanding what’s going on – but regardless, if you’re having issues where stage is null when it shouldn’t be this is usually the cause.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a Flex ArgumentError: Error #2025: The supplied DisplayObject must be a child
I am using Chronic to parse time and it is returning this error: ArgumentError
I get this error: ArgumentError in Videos#index Showing /rubyprograms/dreamstill/app/views/layouts/application.html.erb where line #15 raised: No
i'd like to throw an argument error if a particular function doesn't work without
I'm using Flash CS4 and almost everything is in english, except for errors in
I'm trying to get FlashPunk working in the Flash CS5 IDE (don't ask), and
I have a very complex Flash application (think Photoshop in Flash). There is a
I am getting this error when calling a builder template from sinatra route: wrong
I have the following code: http://scrp.at/FB # Error: # bin/rpg:5:in `<main>': uninitialized constant RubyPasswordGenerator::Korben
I'm trying to use callLater with FlexUnit v0.9: public function testCallLater():void { Application.application.callLater( addAsync(function():void

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.