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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:54:49+00:00 2026-06-03T06:54:49+00:00

My issue is slightly more complicated than the title suggests. I work for a

  • 0

My issue is slightly more complicated than the title suggests. I work for a company that has in the region of 20 flash games. Our players also have avatars which they can customise and these avatars are used inside our games.

We have a file, Avatar.swf which is loaded by our preloader and then passed into GameName.swf. I want to take this Avatar movieclip and create a factory class so we can have many instances of it inside our games.

I can get an instance of the Avatar movieclip from the loader without a problem. There are two way I know of to get a constructor from an instance in AS3.

1.) Object(myInstance).constructor as Class

2.) getDefinitionByName(getQualifiedClassName(myInstance)) as Class

1 works intermittently but about 1 time in 3 I get a null reference error thrown by the resultant instance. I have no idea why but it is not a consistent problem. It’s almost as if the scripts are there but the assets library isn’t. It happens both in debug mode and release mode. It also happens both when compiled using FlashDevelop and CS5.5.

2 throws Error #1065: Variable Avatar is not defined. I understand this is because I have not imported the Avatar package and declared a dummy instance of Avatar but this is the whole point. If we change the avatar by adding a new item of clothing for example, we definitely do not want to have to go through our ever expanding list of games and recompile them all. In other words, I do not want the Avatar code in every game, it would negate the point of loading it in our preloader.

Does anyone have any suggestions?

Thanks!

  • 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-03T06:54:50+00:00Added an answer on June 3, 2026 at 6:54 am
    1. Make sure your Avatar.swf is loaded into the same application domain.
    2. Make sure you have used each of the avatar classes at least once (e.g. in the document class of Avatar.swf), or if they are Flash library items, export them into frame 1 of Avatar.swf.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Issue is SOLVED: Problem is that it is a pre-compiled web page project and
Issue comes up when i try to unload plugin that is loaded and load
My issue is I have a website that is linking to multiple tables in
Greetings, I'm working on a JS-based application that does some complex work and logs
I have a Java EE application that has REST web services attached to it.
I'm having an interesting issue with Leptonica that I'm wondering if other SO members
I'm having an issue with a field being validated that seemingly is failing validation,
I'm seeing a strange rendering issue in an SVG that I'm generating. I've narrowed
This question has been asked in various guises. However. this is a slightly different
I've got a bit of a usability issue that I'd value some input on.

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.