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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:41:36+00:00 2026-05-13T15:41:36+00:00

Question: I get an annoying error: I try to use the type Size in

  • 0

Question: I get an annoying error:
I try to use the type Size in the below actionscript code.
But I always get this error:
1046: Type was not found or was not a compile-time constant: Size.

But no matter what I try, it seems to break when I add

public function get Size():Size

Somehow it doesn’t like the return type Size, but what am I doing wrong ?

package BaseTypes
{
    public class StockData 
    {
        private var size:Size;
        public function get Size():Size
        {
            return this.size;
        }
        public function set Size(value:Size):void
        {
            this.size = value;
        }
    } // End Class
}// End Package

I have the bellow code in folder BaseTypes, and it is in the AS3 class path.

package BaseTypes
{
    public class Size  
    {
        private var width:Number;
        private var height:Number;
        public function Size(width:Number, height:Number)
        {
            this.width = width;
            this.height = height;
        }
        public function get Width():Number
        {
            return this.width;
        }
        public function set Width(value:Number):void
        {
            this.width = value;
        }
        public function get Height():Number
        {
            return this.height;
        }
        public function set Height(value:Number):void
        {
            this.height = value;
        }
        public function toString():String
        {
            return "{width: " +this.width.toString()+ " height: " +this.height.toString() + "}";
        }
    } // End Class
} // End package
  • 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-13T15:41:37+00:00Added an answer on May 13, 2026 at 3:41 pm

    You have named your getter function the same as the class you imported, I think this is the source of your error.

    in your StockData class you have the definition

    public function get Size():Size
    

    you should rename “Size” to either “size” or something that is not the same name as the class you imported.

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

Sidebar

Related Questions

So this question will get technical – eventually – but first check out Hanselminutes
This is a bit of a lazyweb question but you get the rep so
The reason for me asking this question is:- I get a real buzz out
I get asked this question a lot and I thought I'd solicit some input
Question I am trying to dynamically get the default for a type that is
Basically the question is how to get from this: foo_id foo_name 1 A 1
This is not exactly a straight-out question because I have just solved it, but
Question: I have an annoying problem with nhibernate. The problem is I cannot get
There is probably a quite logical explanation to this, but I have a question.
simple and annoying question for you, but i need the answer rather quick and

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.