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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:41:02+00:00 2026-05-22T18:41:02+00:00

I am trying to load assets from an SWC into a SWF at compile

  • 0

I am trying to load assets from an SWC into a SWF at compile time, in as3. I’m getting the information about which assets to load from a JSON file. I can do so statically, but when I try to define the names dynamically, I’m running into problems.

So for example I can do this:

onemech[+ tmpObj.id] = new mech3 as MovieClip;

And it loads the asset named mech3. But what I would like to be able to do is something like

var mechtype:String = "mech" + mechtypenumber;    
onemech[+ tmpObj.id] = new mechtype as MovieClip;

Obviously, that doesn’t work.

I looked around a bit and I found this here, which seems to be angling toward what I need, but I can’t figure out how to apply what’s said there to my specific situation.

For the record, I have control over both the JSON format and the naming schema within the asset SWC, if there’s an easier solution there.

Thanks in advance for any assistance.

  • 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-22T18:41:02+00:00Added an answer on May 22, 2026 at 6:41 pm

    you just need something like this:

    var s:Class = getDefinitionByName("Symbol") as Class;
    addChild(new s());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

trying to load in a bunch of images into a list from a directory...my
I'm trying to load a html page from the assets directory. I tried this,
I'm trying to load my vertices array from assets/model.txt I have OpenGLActivity, GLRenderer and
Here's a sample of the code, which I'm trying to load from rails c
i m trying load UIImages from server asynchronously in UITableViewCell. My code worked fine
Trying to load content into a div, then on click load the previous content
Trying to load a small .txt file into mysql but get all my data
When trying to load Microsoft.Xna.Framework.dll from any project, it throws a FileNotFoundException. The specified
I am trying to load a list of ordered items from the server and
I'm trying to load a text file from res/raw. I've looked at several code

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.