QUOTE(UnknownFury @ 14 Jun, 2009 - 09:02 AM)

Right click the MC in the library and click linkage. You can then give it a class name. If that class exists (has to extend the MovieClip class) already (i.e defined in an AS file) then that class will take on the image of the MC, if not then a new class will be created. You can then refer to it as you would any other class:
CODE
var myMC:libraryMC = new libraryMC();
I guess I sort of understand this, but it's still not quite working right. I just let it make a new class, named Ball, and referred to it in the code. It adds the MC to the stage at the point 100, 100, but it doesn't allow the x-value to change. Here's the code I'm trying to use;
CODE
package {
import flash.display.MovieClip;
import flash.events.Event;
public class Movement extends MovieClip {
private var ball:MovieClip;
public function Movement() {
init();
}
private function init():void {
var ball:Ball = new Ball;
addChild(ball);
ball.x = 100;
ball.y = 100;
addEventListener(Event.ENTER_FRAME,EnterFrame);
}
private function EnterFrame(event:Event):void {
ball.x += 5;
}
}
}
I end up getting this; TypeError: Error #1009: Cannot access a property or method of a null object reference. at Movement/EnterFrame()
Sorry to be a burden, but learning AS3 isn't working out too good for me.