samedi 26 septembre 2015

Error in Drag and Drop quiz done of Flash

I am trying to create a drag and drop game on flash. But i end up got one error, syntax error of #error1083,else is unexpected. The error shows at the line 42, and i dont have any idea which line should i did mistake.

Can someone tell me what is wrong with the code?

Here is the codes

    var objectoriginalX:Number;
    var objectoriginalY:Number;

    blue.buttonMode = true;
    blue.addEventListener(MouseEvent.MOUSE_DOWN, pickObject);
    blue.addEventListener(MouseEvent.MOUSE_UP, dropObject);

    green.buttonMode = true;
    green.addEventListener(MouseEvent.MOUSE_DOWN, pickObject);
    green.addEventListener(MouseEvent.MOUSE_UP, dropObject);

    red.buttonMode = true;
    red.addEventListener(MouseEvent.MOUSE_DOWN, pickObject);
    red.addEventListener(MouseEvent.MOUSE_UP, dropObject);

    function pickupObject(event:MouseEvent):void
        objectOriginalX =;
        objectOriginalY =;

function dropObject (event:MouseEvent):void
    var matchingTargetName:String = + "target" ;
    var matchingTarget: DisplayObject = getChildByName(matchingTargetName);

    if( != null && == matchingTarget);

{,pickupObject);,dropObject); = false; = matchingTarget.x; = matchingTarget.y;

    else { // here is where i got error 1083
   = objectOriginalX;
   = objectOriginalY;

Aucun commentaire:

Enregistrer un commentaire