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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:12:13+00:00 2026-05-12T07:12:13+00:00

In my flex app there are a few custom components. I want to create

  • 0

In my flex app there are a few custom components. I want to create instance of these components at runtime and assign them properties by reading in a config file.
I know how to read xml and instantiate components, however my question is about being able
to get the type of the component from the xml attribute and then creating an instance of that type.
My xml looks like this:

  • 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-12T07:12:13+00:00Added an answer on May 12, 2026 at 7:12 am

    You can instantiate an arbitrary named type through ActionScript’s “reflection API”:

    var clazz:Class = Class(getDefinitionByName("class.from.your.xml.file.Name"));
    var component:Object = new clazz();
    

    http://livedocs.adobe.com/flex/3/langref/flash/utils/package.html#getDefinitionByName()

    If you get an error about the type not existing, this is because it isn’t linked from elsewhere in your application and the compiler only adds classes that are referenced. You can work around this using the following compiler arg:

    includes class [...]
    

    Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.

    http://livedocs.adobe.com/flex/3/html/compilers_14.html#157203

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

Sidebar

Related Questions

I have multiple pieCharts in my flex app and when the user clicks a
Ok, basically my Flex app will open up a socket and listen on it.
I have a Flex application here If you open that link, you'll see it
I have an app that uses a google spreadsheet to populate a menu and
Flex your RCurl/XML muscle. Shortest code wins. Parse into R: http://pastebin.com/CDzYXNbG Data should be:
In my Flex application, users need to be able to upload and download content.
I'm new in Flex 3 and ActionScript. I would like to know how do
I'm developping an Adobe Flex application. I need to detect gps devices when plugged.
I'm trying to write my flex application so that it restores the user's settings
I am currently developing an application using the Flashbuilder 4.5 framework and I am

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.