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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:36:48+00:00 2026-05-20T21:36:48+00:00

A follow-up to my previous question. I have a button on my stage, which

  • 0

A follow-up to my previous question.

I have a button on my stage, which has a class called Game1 (I didn’t define this class, just linked it like Juan answered to my other question). The button has ‘GameButton’ as base class, which at the moment contains some simple x, y statements.

All my buttons will have a dummy class ‘GameX’ and a base class of GameButton; this way they inherit from the base class, but they can still have a different graphic.

I have a main class which contains code to add this button:

public class MainAteam extends MovieClip
{
    public var btn1:Game1;

    public function MainAteam()
    {
        btn1 = new Game1();
        addChild(btn1);
        btn1.addEventListener(MouseEvent.CLICK, startGame1);
    }
    // startGame 1 function here
}

Now, I would like to be able to give x, y values through parameters so I can place each button on a different spot. However, when I try new Game(5,5) and I put the following in the GameObject constructor:

package 
{
 import flash.display.SimpleButton;

 public class GameButton extends SimpleButton
 {
    public function GameButton(startX:Number, startY:Number)
    {
        x = startX;
        y = startY;
    }
  }
}

I get the following error:

1203: No default constructor found in base class GameButton

I don’t really know how to fix this, since I let Flash define the GameX classes for me (I suppose they’re just empty) and use the base class to set some properties. If I just put x=5; y=5, it works fine. Thanks a lot.

  • 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-20T21:36:49+00:00Added an answer on May 20, 2026 at 9:36 pm

    This is one of two things, either you need to call super(); from within your constructor, or you havn’t implemented required class properties/methods on initialization. Try extending Button, not SimpleButton see if that works better for you.

    EDIT
    My first answer was on the right track but still wrong. The problem is that you’re creating your Game1, Game2 etc classes and not calling the constructor of the GameButton class. When you extend a class that has REQUIRED constructor arguments you must provide them using super(); So in this case, inside your Game1 class constructor you need to call:

    super(positionX, positionY);
    

    OR

    You can modify your GameButton constructor to have default values, like so:

    public function GameButton(var x:int = 0, var y:int = 0)
    

    In case you don’t know, super() is just a way to access the constructor of the base class, which can also be called the super class, which is why the method is called super :). Hope this helps.

    ALSO

    Also please note that if you’re creating these Game1, Game2 classes etc from within the Flash IDE (in the library) then you’re going to need to go the route of adding default values to the GameButton constructor as Flash automatically generates classes for library objects. Alternatively, you can still create the graphics in precompiled library clips, and instead of defining a class + base class in the Export For Actionscript settings, create an actual Game1/Game2 etc class manually like you did for GameButton, and then in the Export For Actionscript area put the full qualified class name. Like so:

    enter image description here

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

Sidebar

Related Questions

This is a follow up to a previous question which seems to have confused
This is a follow up from my previous question I have this code basically
This is a follow-on from a previous question, in the implementation, I have two
this is a follow up question of my previous question So I have this
As a follow up to this previous question , I have a Core Data-based
This is a follow-up to a previous question . I have a string Test
note: this is a direct follow up to this previous question I have very
This is a follow up to a previous question . if I have multiple
In a follow-up to a previous question, let's say I have 3 tables, A,
This question is a follow up with a previous question Previous Question The previous

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.