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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:11:39+00:00 2026-06-16T15:11:39+00:00

I inherited a Flash CS3 legacy app and I am trying to refactor it

  • 0

I inherited a Flash CS3 legacy app and I am trying to refactor it a little. Eventually everything is supposed to be moved over to JS, but for now I would like to start working with what I have rather than attempting a complete rewrite. First I would like to install a little regression test.

I am trying to setup the test in it’s own package in order to reducing the seams it has with the original app. The app uses a lot of global variables and I wish not to interfere with those.

I can’t get my regression test to work, since I can’t figure out how to import the package properly. I am pretty certain that I am overseeing something obvious.

My folderstructure looks as follows:

+- ascripts
|     +-- dependencies.as
|
+- root.fla
+- initialize.as
+- regressiontest.as 

root.fla is my one and only fla file. It just contains:

stop();
include "initialize.as" // Let's go outside!

initialize.as contains all the magic. I am using this external file so I don’t have to use the Flash IDE (since it is the worst IDE for coding). In there I have this:

// ... 
import fl.controls.ComboBox;
include "ascripts/dependencies.as"


var t = new regressiontest.TestRunner(); // 1.


// ... 

At 1. I am trying to instantiate my regression test class. It can be found in the file regressiontest.as and looks like this:

package regressiontest {
    public class TestRunner {
        public function TestRunner() {
            trace('Hello');
            // Actual Test Code Here ...
        }
    }
}

So now when I go to flash and debug the movie using Strg+Shift+Enter, I get the following error messages. I tried every way I could think of, so here is an overview of what I achieved so far:

var t = new TestRunner();

Message: 1180: Call to a possibly undefined method TestRunner.

var t = new regressiontest.TestRunner();

Messages:

root.as: 1120: Access of undefined property regressiontest.

regressiontest.as: 5001: The name of package ‘regressiontest’ does not reflect the location of this file. Please change the package definition’s name inside this file, or move the file. folder\regressiontest.as

regressiontest.as: 5008: The name of definition ‘TestRunner’ does not reflect the location of this file. Please change the definition’s name inside this file, or rename the file. folder\regressiontest.as

import regressiontest.TestRunner;
var t = new TestRunner();

root.as, Line 19: 1172: Definition regressiontest:TestRunner could not be found.

root.as, Line 20: 1180: Call to a possibly undefined method TestRunner.

What is most confusing to me is that Flash appears to be picking up the class definition in regressiontest.as somehow. When I put an obvious error, such as

public function TestRunner() {
    shoelace('Hello');
}

and use this to instantiate an object of the class:

var t:TestRunner = new regressiontest.TestRunner();

then I get the Message:

regressiontest.as: 1180: Call to a possibly undefined method shoelace.

One might think now that the instantiation causes the problem. But when I set the code from shoelace to trace and leave the instantiation I get the following messages:

Messages
Scene 1, Layer ‘AS’, Frame 1: 1046: Type was not found or was not a compile-time constant: TestRunner.

root.as: 1120: Access of undefined property regressiontest.

regressiontest.as: 5001: The name of package ‘regressiontest’ does not reflect the location of this file. Please change the package definition’s name inside this file, or move the file. folder\regressiontest.as

regressiontest.as: 5008: The name of definition ‘TestRunner’ does not reflect the location of this file. Please change the definition’s name inside this file, or rename the file. folder\regressiontest.as

I tried renaming the file within the package, I tried renaming the package, I tried importing with import regressiontest.*; and so on. What am I missing?

  • What do I need to set my filename to? Does it need to match the PACKAGE NAME or the CLASS NAME?
  • Am I missing some crazy camel case rule?
  • Is there a maximum length to package names or something crazy like that?
  • Did I forget to configure flash or the FLA file correctly?
  • Am I missing some magic keyword?
  • Might there be sideeffects from the includes or imports at the beginning of my script?

I can reproduce these steps and I can provide the package via github.

Thank you in advance, with clueless greetings from Heidelberg, Germany

Johannes

  • 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-16T15:11:42+00:00Added an answer on June 16, 2026 at 3:11 pm

    As I see it, TestRunner is the class and regressiontest is the package, so you need import the class.

    import regressiontest.TestRunner;
    var t:TestRunner = TestRunner();
    

    Also, you must do this changes.

    1. The filename must be exactly the same of the class, replace regressiontest.as by TestRunner.as
    2. Create a folder for the package and call it regressiontest, put inside TestRunner.as.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've inherited a multi-technology project which comprises a Flash user interface contained in a
I inherited several projects Javas in my new job, but I'm having some problems
I inherited an Intraweb app that had a 2MB text file of memory leaks
Ive inherited some code which started out as an Android project but really is
I inherited a project with drupal and flash, and I'm pretty noobish on the
I have inherited a site which uses a flash ui with a .net 2.0
I've profiled some legacy code I've inherited with cProfile. There were a bunch of
I'm trying to find a way to detect when a flash drive has been
I'm trying to get FlashPunk working in the Flash CS5 IDE (don't ask), and
I am trying to implement something like Ruby on Rail's ActionDispatch::Flash to pass messages

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.