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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:44:29+00:00 2026-05-15T20:44:29+00:00

I wonder if the flash.utils.getDefinitionByName(name:String):Class works with custom classes? Is there a problem if

  • 0

I wonder if the flash.utils.getDefinitionByName(name:String):Class works with custom classes? Is there a problem if the class has a constructor that takes arguments? I tell this because i have a class in a package of the form packageA.packageB and when i input the name of the class into the above function as packageA.packageB.ClassName does not work. Also i have tried (with the same result) the output from getQualifiedClass which gives packageA.packageB::ClassName. Any ideas??

Here is part of the code that belongs to a file that imports like import factory.scratchers.*; all the scratch elements which have the names AlphaScratcher, DissolveScratcheer, ExplodeScratcher ,etc. Does the above import satisfies the requirement?

import factory.scratchers.*;
...
for ( var iArea:uint = 0; iArea < _totalScratchAreas; iArea++ ) {       
                var sourceArray:Array = new Array();
                var currentNameArray:Array = _globalAssetNameArray[iArea];
                var theScratcher:Scratcher;
                for ( var index:uint = 0; index < _globalMsgArray[iArea].length; index++ ) {
                    // here i would like to have something like:>
                    var ScratchClass:Class = getDefinitionByName( "factory.scratchers::ExplodeScratcher") as Class;
                    theScratcher = new ScratchClass( _assetGenerator, _mainSprite );
                    // instead of: - but it does not work not sprite shown on screen
                    theScratcher = new ExplodeScratcher( _assetGenerator, _mainSprite );
                    theScratcher.setBack( currentNameArray[index] );                    
                    sourceArray.push( theScratcher );

                    if ( _globalArray[iArea][4] == OPENEDAREA ) {
                        theScratcher.auto();
                    }
                }
  • 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-15T20:44:30+00:00Added an answer on May 15, 2026 at 8:44 pm

    You should specify what “does not work” means. It’s important whether it’s a runtime or compile-time error.

    Input to getDefinitionByName should always be a string, of the format “package.subpackage.subpackage::Class”, so:

    var MyClass:Class = getDefinitionByName("packageA.packageB::ClassName") as Class;
    var myInstance:Object = new MyClass();
    

    Note that Flash will not include ClassName in your movie unless it is specifically mentioned somewhere in your code. To avoid this, place this somewhere in your main section of code:

    var MyClass:ClassName;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if it is possible to build a game with flash/silverlight that has
Some Flash components have the method setStyle(style:String, value:Object). I wonder where/if I can find
I wonder how can I work with mp3 that was loaded to to flash
I wonder why no browser out there has such simple but essential feature. Am
I see all this heavy Flash/3D websites and it's making me wonder how do
wonder what's wrong <table id=tblDomainVersion> <tr> <td>Version</td> <td>No of sites</td> </tr> <tr> <td class=clsversion>1.25</td>
wonder if someone could help me with a little problem. I have session values
Just wonder is there a way to implement heapify operation in a functional style
I wonder how can i run web flash application on IOS? Because i heard
i wonder if somebody knows how to trigger thickbox from onRelease() event in flash.

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.