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:
include "Main.as"
then in the Main.as file I have the following code:
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