# Packages cannot be nested

**URL:** <https://forum.kirupa.com/t/packages-cannot-be-nested/257943>\
**Category:** flash\
**Created:** [April 18, 2008, 6:06pm UTC](https://forum.kirupa.com/t/packages-cannot-be-nested/257943 "2008-04-18T18:06:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobcooper](https://avatars.discourse-cdn.com/v4/letter/b/b19c9b/32.png) [@bobcooper](https://forum.kirupa.com/u/bobcooper)\
**Post date:** [April 18, 2008, 6:06pm UTC](https://forum.kirupa.com/t/packages-cannot-be-nested/257943/1 "2008-04-18T18:06:14Z")

</div>

Hi there,

I am trying to learn actionscript 3 and getting very confused… I am trying a basic piece of code that will cause a movieclip to rotate I have the movieclip with instance name rotatingMC and an actions layer with the following code:

```auto
include "Main.as"

```

then in the Main.as file I have the following code:

```auto
package {
    import flash.display.MovieClip;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    
    public class Main extends MovieClip {
        
        /**
        * Constructor
        */
        public function Main() {
            var spinTimer:Timer = new Timer(50);
            spinTimer.addEventListener(TimerEvent.TIMER, timerHandler);
            spinTimer.start();
        }
        
        /**
        * Timer Event handler to spin the movieclip
        */
        public function timerHandler(event:TimerEvent):void{
            rotatingMC.rotation+=3;
        }
    }
}

```

However I keep getting the error…

1037 packages cannot be nested

I’m getting really confused, what am I doing wrong?

I’m hoping it will all make sense soon and I can reap the benefits of actionscript 3 but at the moment i prefer actionscript 2

Cheers,

Bob
