Adobe Technical Support is adamant that the source file size of any included or imported .as file must not exceed 32K (see

Helper .as files can be created with chunks of code.

  1. Copy the top part of the original class to a new file and save it in a helper subfolder in the directory of the current class, e.g., classes/edu/clips/draw/helper
  2. Change the name of the class (e.g., from ubShape to ubShape_Helper1) in the class statement and create statements etc. There seems to be some sort of size limit that makes a class with a length like edu.clips.graph.helper.ubSkipCountingTool_Helper1 too long.
  3. Add helper to the class definition path e.g.,
    class edu.clips.draw.helper.ubShape_Helper1 extends MovieClip {
    static var symbolName:String = "";
  4. Delete the code inside the constructor function. Delete getVersionInfo.
  5. Remove comments for the properties.
  6. Search for any existing .call() methods and any MouseManagers or other things that already use scope-changing calls.
  7. To move the code from inside a method like set(parm1, parm2) to the helper class do the following:
    1. Add an import statement at the top of the class, e.g., import edu.clips.draw.helper.ubShape_Helper1;
    2. Add a private var for the new instance of the helper. e.g., private var helper1:ubShape_Helper1;
    3. create an new instance of the helper in the constructor. e.g.,
      this.helper1 = ubShape_Helper1.create(this, "h1", {});
      This needs to be done before the first method that is called by it. If the class creates movieclips at specific depths, then you will need to be careful to put the helpers at at depth that won't contradict their name.
    4. copy methods from the original class to the helper - something around 600 lines is about the size (27K) desired.
    5. replace the inside of the method in the original class with an equivalent call to the helper.
      function set(newShape, newSize, newColour){, newShape, newSize, newColour);
      The call statement is used to scope "this" in the helper's function as the instance of the original class.
    6. If the function returns a value, then return should be added in front of the call. This is one reason why is it good to declare the return type with the variable so that someone doesn't spend two hours figuring out why a class is broken.
  8. Test with an .fla that uses the class. Note any compiler errors.
    1. You may need to add declarations to functions that don't appear in the helper. e.g.,
      private var tracev:Function;
      private var addGroupAccoutrement:Function;
      private var addAccoutrement:Function;
    2. Functions in the helper class will need to be public.
  9. Be very careful of references to static variables or functions, these will have to have the main class' name used with them.

Changing classes to use "CLIPS_Empty"

Each class and helper that extends Movieclip should be changed as follows - all of which can be accomplished by doing a


  1. The create function should be changed to look like:
    public static function create(container:MovieClip, instanceName:String, initObj:Object, depth) {
        //this function will attach a ubOptionButton object on the container with the instance name
        symbolName = "CLIPS_Empty";
        symbolLinked = Object.registerClass(symbolName, symbolOwner);
        if (depth == undefined) {
            var mc = container.attachMovie(symbolName,instanceName,container.getNextHighestDepth(),initObj);
        } else {
            var mc = container.attachMovie(symbolName,instanceName,depth,initObj);
        if (mc == undefined) trace("Warning:  ubOptionButton_Helper1.create failed for "+container+"["+instanceName+"] - do you have CLIPS_Empty in the library?");
        return ubOptionButton_Helper1(container[instanceName]);

    The first two lines are new. The two "var mc = " are new. The "if" is new and its trace should reflect the class name

  2. Each helper class should have a static getVersionInfo method.
    public static function getVersionInfo():String {
        return "ubOptionButton_Helper1 Version November 23, 2011";

    and each main class should call the getVersionInfo method of all its helpers (that is right ubSCT....).
    /**Used to determine which version of the class is actually stored and used
    *@returns (String) Details of the current version. */
    public static function getVersionInfo():String {
        return "ubOptionButton Version November 23, 2011";


  3. Each class should have an instance variable declaration
    /**used to decide whether more traces should appear.  */
    public var verbose:Boolean = false;


Work Schedule

Make sure that all classes are 32K or less

  • ubFractionMultOpTool - Greg

  • ubMenuHelper2 - Greg
  • ubToolContainer - Greg

  • ubShape - Ross (done)
  • ubFractionInput - Markus (done)
  • ubFraction - Markus (done)
  • ubFraction_Helper1 - Markus (done)
  • ubMovieClipTransform - Ross (done)
  • ubMultipleSelect - Greg (done - Ross)
  • ubEstimator - Markus (done)
  • ubOptionButton - Ross (done)
  • ubNumberLine2 - Ross (done)
  • ubSkipCountingTool and several helpers - Greg (done)
  • ubSuperHops & ubSuperHops_Helper2 - Greg (done)
  • ubFractionSquare and helpers - Greg (done)
  • ubFractionStripToolBox and helpers - Bailey (and Greg) (done)
  • ubFractionOpTool and ubFractionOpToolSimulator (Greg) (done)
  • ubIntegerOpTool (Greg) (done)