View Full Version : [AS3] [F3] - Creating Rotational Arm

03-13-2009, 11:29 PM

Looking for some help creating an arm, I'm using flex and flash together in this one, I have a movie clip of an arm called "LightGun" and a file called LightGun.as that references this.

here is what I have so far, it pumps out an error and I'm totally confused with mouse events, can anyone help me with this? what I'm looking for basically is rotational movement on an axis. I've seen a couple tutorials but they haven't really helped.

//The LightGun

package classes {

import com.citrusengine.events.*;

import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;

public class LightGun extends MovieClip{

public function LightGun() {

private function init(e:Event):void {

addEventListener(Event.ADDED_TO_STAGE, init);

removeEventListener(Event.ADDED_TO_STAGE, init);
//this.y += 200
//this.x += 200;

var LightGunXY:LightGun = new LightGun();

addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);

function track(e:Event):void{
LightGunXY.x = mouseY;
LightGunXY.y = mouseX;