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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:30:21+00:00 2026-06-10T11:30:21+00:00

Is there a way to pass an object reference to a component directly from

  • 0

Is there a way to pass an object reference to a component directly from the property/component parameter window? Using the [Inspectible] tag only allows me to input strings and not actual object references.

For example, I have a custom component called “knob” which should hold a reference to a door on the stage which it opens. I know this can be easily done in code with “knob.door = someDoor;” but since there are many objects in the scene I would prefer if I could do it visually trough the properties window.

  • 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-10T11:30:22+00:00Added an answer on June 10, 2026 at 11:30 am

    I don’t think you can do this. Your best bet is to pass in a string identifier (perhaps a whole dot-separated path if your clips are deeply nested), and then implement code inside your custom component to find that item by name.

    I’ve got a custom component which lays itself out relative to horizontal and vertical predecessor components, so I do this:

    protected var horizontalPredecessor:String = "";
    
    [Inspectable(name = "HorizontalPredecessor", type = String, defaultValue="")]
    public function set HorizontalPredecessor($value:String):void 
    { 
        horizontalPredecessor = $value;
        drawNow();
    }
    
    override protected function draw():void
    {
        if (parent)
        {
            if (horizontalPredecessor != "")
            {
                var hp:DisplayObject = parent.getChildByName(horizontalPredecessor);
                if (hp)
                {
                    x = hp.y + hp.height + horizontalSpacing;
                }
            }
        }
    }
    

    … which is made easy because all these components share the same parent.

    Alternatively, if there’s only one door, you could make it a singleton, and give it a static reference, like this:

    public class Door
    {
         private static var _singleton:Door;
    
         public static function get Singleton():Door
         {
             if(!_door) _door = new Door();
             return _door;
         }
    
    }
    

    Then your handle can just refer to Door.Singleton and you don’t have to worry about passing anything in. Alternatively, you could have a static array of Doors in the Door class, and give your handle an index number to link it to a specific Door.

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

Sidebar

Related Questions

Is there a way that I can pass in a reference to an object,
Is there any way to pass a callback to java code, from C. And
Is there a way to pass a class into a property as a Class
Is there a way to pass a null value to a parameter in C#?
Is there a way to pass user credentials over a WCF service without using
I'm wondering if there's a way for Binding object to store reference to an
Is there a way to determine the Object type, when passing a reference to
In a function is there a way to get a reference to the object
Is there a way to pass results generated within a PHP page (called into
Is there any way to pass HTTP AUTH username and password along with an

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.