mercredi 15 mars 2017

Drag & Drop - ActionScript3

I am developing a simple flash game - a drag and drop game for children.

I have created three animal instances which will be dragged and dropped to the correct space. I am just adding action script and am getting the following error when trying to add drag and drop functions;

Scene 1, Layer 'Actions', Frame 1, Line 10, Column 44 1119: Access of possibly undefined property startDragging through a reference with static type String.Scene 1, Layer 'Actions', Frame 1, Line 10, Column 44 1136: Incorrect number of arguments. Expected 2.

My code is as follows; import flash.events.MouseEvent;

stop();

//set up the buttons for the puzzle pieces

Pig.buttonMode=true;

Pig.addEventListener(MouseEvent.MOUSE_DOWN.startDragging);
Pig.addEventListener(MouseEvent.MOUSE_UP.stopDragging);

function startDragging(e:MouseEvent){


trace("startDragging");

}

function stopDragging(e:MouseEvent){

trace("stopDragging");

}

Aucun commentaire:

Enregistrer un commentaire