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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:13:56+00:00 2026-05-29T09:13:56+00:00

I have a dynamic Class and what I would like to do is call

  • 0

I have a dynamic Class and what I would like to do is call a method everytime a property is appended to the class during run-time.

For example:

dynamic class Example
{

    public function Example()
    {
        trace("New instance created");
    }

    public function setter(name:String, value:String):Void
    {
        trace("Property '"+name+"' created with value '"+value+"'");
    }
}

And then from the timeline when I would add a new property to Example:

Example.newProperty = "some value";

I want it to trace:

Property ‘newProperty’ created with value ‘ some value’

I am fully aware that this is capable by using a function to set properties like so:

public function setter(name:String, value:String):Void
{
    this[name] = "some value";
    trace("Property '"+name+"' created with value '"+value+"'");
}

and calling it like so:

Example.setter("newProperty", "some value");

However I want this method to fire automatically when a property is added via the regular .dot operator and not have to call a function explicitly.

Is this possible?

  • 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-29T09:13:56+00:00Added an answer on May 29, 2026 at 9:13 am

    Since it’s AS2, then, yes, your class has to implement __resolve(x) method. I would, however, consider it a very questionable design decision. The function that accepts the key and the value looks much better to me, and, in the end, it’s less code.

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

Sidebar

Related Questions

I have to make dynamic hashes, so the class example won't work since the
I have a method that returns byte[] but for now would like to avoid
I would like to create a new dynamic chart control. This chart will have
Let's say I have a Rectangle class like so: class Rectangle { public: double
In templates as shown below, I would like the call Run(&Base::foo) succeed without the
I have a generic abstract base class from which I would like to derive
I have a dynamic class that serves as a storage container for configuration settings.
I need to have a dynamic URL preferably from a Test Class. Can any
Is it possible or makes sense to have static dynamic variables on a class,
I have written a helper class which uses the Action - delegate as method

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.