I've been following a tutorial for a simple animation but I'm failing to get the library items to display on the stage. It's probably something really simple. Here is the code in my Main.as
I also receive the errors 1119 and 1061.
If anyone can help that would be fab and much appreciated.
package {
import flash.display.MovieClip;
import flash.events.Event;
public class Main extends MovieClip {
var touching:Boolean = false;
public function Main() {
startGame();
}
function startGame():void {
stage.addEventListener(Event.ENTER_FRAME, gameLoop);
}
function gameLoop(e:Event):void {
fly();
checkCollisions();
}
function fly():void {
if (touching == false) {
player.x ==30;
} else if (touching == true) {
stage.removeEventListener(Event.ENTER_FRAME, gameLoop);
}
}
function checkCollisions():void {
if (player.hitTestObject(square)) {
touching = true;
} else {
touching = false;
}
}
}
}