package A
{
import flash.display.MovieClip;
import flash.events.Event;
public class Mover extends MovieClip
{
private var targetMC:MovieClip;
public function Mover(targetMC:MovieClip)
{
this.targetMC = targetMC;
}
private function updatePosition(evtObj:Event):void
{
this.targetMC. x++;
this. targetMC.y++;
}
public function startMoving():void
{
this.targetMC.addEventListener(Event.ENTER_FRAME, this.updatePosition);
}
public function stopMoving():void
{
this.targetMC.removeEventListener(Event.ENTER_FRAME, this.updatePosition);
}
}
}
and in my Fla i had writen
var circleMover:Mover = new Mover(circle);
circleMover.startMoving();
but the error i am getting is
ArgumentError: Error #1063: Argument count mismatch on A::Mover$iinit(). Expected 1, got 0.
[quote=Felixz;2330515]If u really want to have things like they are ActionScript Code:
[LEFT][COLOR=#0000FF]public[/COLOR] [COLOR=#000000]function[/COLOR] MoverCOLOR=#000000[/COLOR]
[/LEFT]
[/quote]
i tried and got this error
Error: Error #2136: The SWF file file:///G|/eman%20rnd/class/test.swf contains invalid data.
at Main/::frame1()