lundi 27 juin 2016

Cloning drag and drop, snap to grid

Im a beginner at ActionScript3 and Im trying to create a a game where by the user is able to duplicate an object using the drag and drop method, and is still able to reposition the duplicates that snap to grids-

Cube_1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
Cube_1.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler1);

function mouseDownHandler1(evt:MouseEvent):void {
    var object =;

function mouseUpHandler1(evt:MouseEvent):void {
    var obj =;

I managed to find these codes but but Im unable to make it duplicate as Im unsure of how to go around doing so. Are there any ways I can improve on this?


Aucun commentaire:

Enregistrer un commentaire