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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:04:54+00:00 2026-05-29T10:04:54+00:00

I’m building a little tool that lets user to place some geometric figures on

  • 0

I’m building a little tool that lets user to place some geometric figures on screen and then move them around and change their properties. I’m quite new to as3/flex.

Figures are represented as objects in as3. So we’ve got Circle, Triangle, Rectangle classes with different properties.

What I like to do is to display some kind of “object inspector” when user selects a figure. This inspector window would resemble similar thing found in many IDEs.

Now the question is: Is it possible to take advantage from as3 [Inspectable] tag to obtain list of properties and enable changing them at runtime?

If it’s not possible then how would you approach this problem without writing type specific code to edit each object?

Edit:

Just to clarify. Consider this example:

public class Shape { /* ... */ }

public class Triangle extends Shape { 
  public var a:Number;
  public var h:Number;
  //...
}

public class Circle extends Shape {
  public var r:Number;
  public var name:String;
  //...
}

I want to give the user an ability to edit a, h from Triangle and r, name from Circle.

From what I imagine now, I could follow two paths:

  1. Make Triangle and Circle implement IMyInspectable and write custom getProperties():Dictionary, getProperty(name:String):Object and setProperty(name:String, value:Object):void methods for each type. This would involve utterly unelegant switch-spaghetti.

  2. I forgot when I was typing the solution number one. 🙁

  • 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-29T10:04:54+00:00Added an answer on May 29, 2026 at 10:04 am

    I think you can use describeType to introspect objects. I would probably take a very different approach, though.

    Create an interface, something like IObjectIWantToCreatePropertyWindowFor and have your relevant shape objects implement this. The interface could somehow define the list of properties you want edtiable on the object. I might even make this an array of Value Objects that contain the property name, a display name, and the type of editor it should have. Each object can hard code this list of properties in it.

    The property window could be written to redraw itself based on the interface values. Most likely I’d do that using a List class with an itemRendererfunction somehow.

    What you want to do doesn’t sound hard, but it’s not trivial either.


    Nooga asked a more detailed explanation. This is all psuedo code, but:

    1) Create an interface:

    package com.propertyInspector
    {
    
        public interface IPropertyInspectable
        {
    
            function get inspectableProperties(  ):array;
        }
    }
    

    2) Create a class that implements IPropertyInspectable

    package com.propertyInspector
    {
    
        public class myClass implements IPropertyInspectable
        {
    
            public var property1 :String
            public var property2 : Int
    
            public function get inspectableProperties():Array{
              return [{name:'property1',type:'String'},{name:'property2',type:'String'}, ]
            }
        }
    }
    

    3) Create your property inspector.

    <s:List dataProvider="{someSelectedObjectThatImplementsIPropertyInspectable.inspectableProperties}">
     <s:itemRenderer>
       <s:Label text="data.name"/><s:TextInput />
     </s:itemRenderer>
    </s:List>
    

    You’ll have to figure out how to pass the objects into the property inspector. And the property objects in inspectableProperties will probably need a reference to the actual object they refer to so that the List can display default values.

    And you can use an itemRenderer function to display different editable approaches based on the type. a TextInput for Strings, a NumericStepper for numbers, and so on.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

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.