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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:44:05+00:00 2026-06-06T10:44:05+00:00

Whenever I try to extend the Object prototype, I get an error: Error #1056:

  • 0

Whenever I try to extend the Object prototype, I get an error:

Error #1056: Cannot create property my_extension on mx.core.UIComponentDescriptor.

I searched around, and found these:

Flash AS3: ReferenceError: Error #1056: Cannot create property

ReferenceError: Error #1056 – instance name Error

I’m not using a visual IDE for designing a stage, but MXML and AS3 files, so I’m not sure what to make of this error.

My code:

Object.prototype.keys = function(): Array {
  var keys: Array = [];

  for (var key: * in this) {
    keys.push(key);
  }

  return keys;
}

Object.prototype.values = function(): Array {
  var values: Array = [];

  for each (var value: * in this) {
    values.push(value);
  }

  return values;
}
  • 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-06T10:44:07+00:00Added an answer on June 6, 2026 at 10:44 am

    Using prototype to extend a class seems very ActionScript 1 or 2.

    In AS3, you may be able to prototype if the class is dynamic.

    There are downsides to prototype:

    • Only dynamic classes can be extended, one can not add methods to Math for example.
    • Calls to methods stored in the prototype take longer to execute.
    • Since methods are added at run-time, editors can not show them with code hinting or use the correct syntax highlighting.

    Since all classes extend object, it is not necessary to explicitly declare Object as a base; however, you could define an AbstractObject class to be extended:

    package
    {
    
        public dynamic class AbstractObject extends Object
        {
    
            public function AbstractObject()
            {
                super();
            }
    
            public function get keys():Array
            {
                var keys:Array = [];
    
                for (var key:* in this)
                {
                    keys.push(key);
                }
    
                return keys;
            }
    
            public function get values():Array
            {
                var values:Array = [];
    
                for each (var value:* in this)
                {
                    values.push(value);
                }
    
                return values;
            }
    
        }
    }
    

    Subtype AbstractObject for your classes.

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

Sidebar

Related Questions

whenever I try to call my ejb from a client, I get this error
Whenever i try using php with lighttpd on my iphone i get error 500
Whenever I try to open .pyc or .pyo files, I always get an error
Whenever i try to run sqlmetal, i get this: 'sqlmetal' is not recognized as
Has anyone seen this error before? It comes whenever I try to execute a
When I try to delete a Course object, I get this exception: Referential integrity
whenever I try to return the lat/long coordinates for my current location, my application
Whenever I try (My)SQL queries on the sever (the server is in debug mode
Whenever I try the following in my python interpreter. I am able to copy
Whenever I try to test my code with JUnit, I receive a NullPointerException -

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.