# Why do I get the error "Packages cannot be nested"?

**URL:** https://forum.kirupa.com/t/why-do-i-get-the-error-packages-cannot-be-nested/633215
**Category:** talk
**Created:** [May 21, 2015, 12:50am UTC](https://forum.kirupa.com/t/why-do-i-get-the-error-packages-cannot-be-nested/633215 "2015-05-21T00:50:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dude1111](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Dude1111](https://forum.kirupa.com/u/Dude1111)
#### Post date: [May 21, 2015, 12:50am UTC](https://forum.kirupa.com/t/why-do-i-get-the-error-packages-cannot-be-nested/633215/1 "2015-05-21T00:50:51Z")

</div>

I had a FLA file that somehow had the AS3 erased, then I found the SWF and decompiled the file and retrieved the code.  
It is the same code as before, and yet when I output it I get the error “Packages cannot be nested”.

I have seen them nested before, and the Adobe site says you can do this.

What can I do?

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [May 21, 2015, 3:30am UTC](https://forum.kirupa.com/t/why-do-i-get-the-error-packages-cannot-be-nested/633215/2 "2015-05-21T03:30:57Z")

</div>

Packages can’t be nested… The error message doesn’t refer to `com.example.foo` being nested within `com.example`. It means that you can’t have code like:

```actionscript
package com {
     package example {

    }
}

```

This also applies to timeline/frame scripts, because they’re implicitly wrapped into a class and package.

> [@Dude1111](#):
>
> I have seen them nested before, and the Adobe site says you can do this.

Really? What’d it look like in code? And where does Adobe’s site say it?
