as2 to as3 the class or interface 'MouseEvent' could not be loaded
im using as2 but the scripts are supposed to be in as3
here's the code in as3:
for (var i:int=0; i<10; i++){
var newFood:mcFood=new mcFood();
newFood.buttonMode=true;
newFood.x = (Math.random()*510);
newFood.y = (Math.random()*310);
if(newFood.x>550){
newFood.x -=530;
}
if(newFood.y>550){
newFood.y -=530;
}
addChild(newFood);
newFood.addEventListener(MouseEvent.MOUSE_DOWN, mousePressed);
newFood.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
}
function mousePressed(myVar:MouseEvent):void{
myVar.target.startDrag();
}
function mouseReleased(myVar:MouseEvent):void{
myVar.target.stopDrag();
if(myVar.target.hitTestObject(star)){
myVar.target.x = -300;
myVar.target.y = -30;
}
}
could anyone transform this into as2?