# How to make module not importing packages imported in shell

**URL:** <https://forum.kirupa.com/t/how-to-make-module-not-importing-packages-imported-in-shell/318540>\
**Category:** Uncategorized\
**Created:** [January 23, 2011, 1:33pm UTC](https://forum.kirupa.com/t/how-to-make-module-not-importing-packages-imported-in-shell/318540 "2011-01-23T13:33:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Broadsmile](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@Broadsmile](https://forum.kirupa.com/u/Broadsmile)\
**Post date:** [January 23, 2011, 1:33pm UTC](https://forum.kirupa.com/t/how-to-make-module-not-importing-packages-imported-in-shell/318540/1 "2011-01-23T13:33:52Z")

</div>

I’m programming pure AS 3 in flex SDK using FlashDevelop.

There is a Shell and a Module. The Shell loads the Module. Module is never run without the Shell. Because there will be more modules, I decided to put common classes to Shell.

**1. Compiled Shell with**  
-link-report obj\Shell\_Extern.xml

**2. Compiled Module with**  
-load-externs obj&lt;ShellProject\>\_Extern.xml

Module size shrank from 90 KB to 2,05 KB.

**3. Added 5 filters to Module:**  
import flash.filters.\*;  
tf.filters = [new GlowFilter(), new GradientGlowFilter(), new DropShadowFilter(), new BevelFilter(), new BlurFilter()];

Module size grew to 2,15 KB.

**4. Added 5 filters to Shell (same code as above), recompiled it, then recompiled Module.**  
Module size still at 2,15 KB.

**5. Tried getDefinitionByName**  
//import flash.filters.\*; commented out  
var GlowFilter:Class = Class(getDefinitionByName(“GlowFilter”));  
var GradientGlowFilter:Class = Class(getDefinitionByName(“GradientGlowFilter”));  
var DropShadowFilter:Class = Class(getDefinitionByName(“DropShadowFilter”));  
var BevelFilter:Class = Class(getDefinitionByName(“BevelFilter”));  
var BlurFilter:Class = Class(getDefinitionByName(“BlurFilter”));

Error #1065 GlowFilter not initialized, Module size grew to 2,19 KB. Deleting some, but not all filters is decreasing size, so it’s not the getDefinitonByName that takes 0,14 KB (2,19 - 2,05 without filters).

My questions:

1. Do I understand the idea of load externs, or does it work only with specific classes? Why it doesn’t work with filters?
2. What did I screw up with getDefinitionByName and is it a new feature because of it’s use like in link below?  
[http://www.ultrashock.com/forum/viewthread/104606/](http://www.ultrashock.com/forum/viewthread/104606/)
