Error 1084.
hey,
so after hours worth of googling no success, decided might ask here. i'm getting error in code drag , drop game i'm developing project. i'm still learning appreciated.
scene 1, layer 'actions', frame 4 | 1084: syntax error: expecting rightbrace before end of program.' |
code:
var objectoriginalx:number;
var objectoriginaly:number;
dynamics1.buttonmode = true;
dynamics1.addeventlistener(mouseevent.mouse_down, pickupobject);
dynamics1.addeventlistener(mouseevent.mouse_up, dropobject);
dynamics2.buttonmode = true;
dynamics2.addeventlistener(mouseevent.mouse_down, pickupobject);
dynamics2.addeventlistener(mouseevent.mouse_up, dropobject);
dynamics3.buttonmode = true;
dynamics3.addeventlistener(mouseevent.mouse_down, pickupobject);
dynamics3.addeventlistener(mouseevent.mouse_up, dropobject);
pitches1.buttonmode = true;
pitches1.addeventlistener(mouseevent.mouse_down, pickupobject);
pitches1.addeventlistener(mouseevent.mouse_up, dropobject);
pitches2.buttonmode = true;
pitches2.addeventlistener(mouseevent.mouse_down, pickupobject);
pitches2.addeventlistener(mouseevent.mouse_up, dropobject);
pitches3.buttonmode = true;
pitches3.addeventlistener(mouseevent.mouse_down, pickupobject);
pitches3.addeventlistener(mouseevent.mouse_up, dropobject);
textures1.buttonmode = true;
textures1.addeventlistener(mouseevent.mouse_down, pickupobject);
textures1.addeventlistener(mouseevent.mouse_up, dropobject);
textures2.buttonmode = true;
textures2.addeventlistener(mouseevent.mouse_down, pickupobject);
textures2.addeventlistener(mouseevent.mouse_up, dropobject);
textures3.buttonmode = true;
textures3.addeventlistener(mouseevent.mouse_down, pickupobject);
textures3.addeventlistener(mouseevent.mouse_up, dropobject);
timbres1.buttonmode = true;
timbres1.addeventlistener(mouseevent.mouse_down, pickupobject);
timbres1.addeventlistener(mouseevent.mouse_up, dropobject);
timbres2.buttonmode = true;
timbres2.addeventlistener(mouseevent.mouse_down, pickupobject);
timbres2.addeventlistener(mouseevent.mouse_up, dropobject);
timbres3.buttonmode = true;
timbres3.addeventlistener(mouseevent.mouse_down, pickupobject);
timbres3.addeventlistener(mouseevent.mouse_up, dropobject);
rhythms1.buttonmode = true;
rhythms1.addeventlistener(mouseevent.mouse_down, pickupobject);
rhythms1.addeventlistener(mouseevent.mouse_up, dropobject);
rhythms2.buttonmode = true;
rhythms2.addeventlistener(mouseevent.mouse_down, pickupobject);
rhythms2.addeventlistener(mouseevent.mouse_up, dropobject);
rhythms3.buttonmode = true;
rhythms3.addeventlistener(mouseevent.mouse_down, pickupobject);
rhythms3.addeventlistener(mouseevent.mouse_up, dropobject);
function pickupobject(event:mouseevent):void {
event.target.startdrag(true);
event.target.parent.addchild(event.target);
objectoriginalx = event.target.x;
objectoriginaly = event.target.y;
}
function dropobject(event:mouseevent):void {
event.target.stopdrag();
var matchingtargetname:string = "target" + event.target.name;
var matchingtarget:displayobject = getchildbyname(matchingtargetname);
if (event.target.droptarget != null && event.target.droptarget.parent == matchingtarget){
event.target.removeeventlistener(mouseevent.mouse_down, pickupobject);
event.target.removeeventlistener(mouseevent.mouse_up, dropobject);
event.target.buttonmode = false;
event.target.x = matchingtarget.x;
event.target.y = matchingtarget.y;
} else {
event.target.x = objectoriginalx;
event.target.y = objectoriginaly;
}
}
sorted out compile , output errors far, drag , drop isn't working. getting no interaction mcs in place. still appreciated.
More discussions in Adobe Animate CC - General
adobe
Comments
Post a Comment