TheThirdL3g
02-16-2009, 08:15 PM
Ok, i am getting this error when i try to test my movie.
[QUOTE]5006: An ActionScript file can not have more than one externally visible definition: AvoiderGame, moveEnemy[Quote]
My two .as files are:
AvoiderGame.as:
package {
import flash.display.MovieClip;
import flash.utils.Timer;
import flash.events.TimerEvent;
public class AvoiderGame extends MovieClip {
public var enemy:Enemy;
public var gameTimer:Timer;
public function AvoiderGame() {
enemy = new Enemy();
addChild( enemy );
gameTimer=new Timer(25);
gameTimer.addEventListener( TimerEvent.TIMER, moveEnemy );
gameTimer.start();
}
}
public function moveEnemy( timerEvent:TimerEvent ):void {
enemy.moveDownABit();
}
}
and
Enemy.as
package {
import flash.display.MovieClip;
public class Enemy extends MovieClip {
public function Enemy() {
x=100;
y=15;
}
public function moveDownABit():void {
y=y+3;
}
}
}
Any help would be appreciated.
[QUOTE]5006: An ActionScript file can not have more than one externally visible definition: AvoiderGame, moveEnemy[Quote]
My two .as files are:
AvoiderGame.as:
package {
import flash.display.MovieClip;
import flash.utils.Timer;
import flash.events.TimerEvent;
public class AvoiderGame extends MovieClip {
public var enemy:Enemy;
public var gameTimer:Timer;
public function AvoiderGame() {
enemy = new Enemy();
addChild( enemy );
gameTimer=new Timer(25);
gameTimer.addEventListener( TimerEvent.TIMER, moveEnemy );
gameTimer.start();
}
}
public function moveEnemy( timerEvent:TimerEvent ):void {
enemy.moveDownABit();
}
}
and
Enemy.as
package {
import flash.display.MovieClip;
public class Enemy extends MovieClip {
public function Enemy() {
x=100;
y=15;
}
public function moveDownABit():void {
y=y+3;
}
}
}
Any help would be appreciated.