# Questions about using library items in loaded .swf

**URL:** <https://forum.kirupa.com/t/questions-about-using-library-items-in-loaded-swf/298558>\
**Category:** flash\
**Created:** [October 21, 2009, 2:55am UTC](https://forum.kirupa.com/t/questions-about-using-library-items-in-loaded-swf/298558 "2009-10-21T02:55:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)\
**Post date:** [October 21, 2009, 2:55am UTC](https://forum.kirupa.com/t/questions-about-using-library-items-in-loaded-swf/298558/1 "2009-10-21T02:55:58Z")

</div>

Hi,

Say I have _master.swf_ which loads _test.swf_ which contains library items _L1, L2, L3,_ etc …

Q1) My understanding is that once I create an instance of _L1_ it sits in the memory and I can keep creating instances of _L1_. Is this subject to garbage collection? (running System.gc does not seem to have an effect)

Q2) if I do somthing like this:

```auto
var L1:Class = evt.target.applicationDomain.getDefinition('L1') as Class
var myL1:MovieClip = new L1() as MovieClip;
addChild(myL1);

```

I can then do this

```auto
var _L1:L1 = new L1;
addChild(_L1);

```

as much as I want. Is that correct? (Is there a better way?)

Q3) If I create _L1_ as above, and in the constructor of _L1_ it creates an _L2_, from what I can tell, I don’t need to call an _L2_ to get it into the memory (as I had to with _L1_)? It seems that as _L1_ and _L2_ are from the same .swf (eg _test.swf_) that they can happily create each other even if they are creating instances of each other in other swfs (eg _master.swf_).

In other words a _L1_ can create an _L2_ in _master.swf_ without having to use _getDefinition_ etc even though _L2_ is not loaded into memory. Is that correct?

Thanks for your consideration and help!

S.
