drag and drop target help please
hi! need movie clip play, or go frame, or make happen when draggable items have been dropped onto the targets. can please tell me how based on code? im sure it's pretty basic can't figure out.
much!
// start points
// these original starting points draggers
// snap if wrong.
var start1x:number = ciarahair_movieclip._x;
var start1y:number = ciarahair_movieclip._y;
var start2x:number = greghair_movieclip._x;
var start2y:number = greghair_movieclip._y;
var start3x:number = ciaraeyes_movieclip._x;
var start3y:number = ciaraeyes_movieclip._y;
var start4x:number = gregeyes_movieclip._x;
var start4y:number = gregeyes_movieclip._y;
// allow movieclips dragged mouse
// start drags�
ciarahair_movieclip.onpress = function() {
startdrag(this);
};
greghair_movieclip.onpress = function() {
startdrag(this);
};
gregeyes_movieclip.onpress = function() {
startdrag(this);
};
ciaraeyes_movieclip.onpress = function() {
startdrag(this);
};
// drop them..
// drag 1 gets dropped on drop1
// else goes start position
ciarahair_movieclip.onrelease = function() {
// stop dragging
this.stopdrag();
// if correct drop zone
if (eval(this._droptarget) == dropciarahair_mc) {
// leave there
this._x = dropciarahair_mc._x;
this._y = dropciarahair_mc._y;
sound1.gotoandplay(2);
} else {
// take start pos
this._x = start1x;
this._y = start1y;
}
};
//drag 2
greghair_movieclip.onrelease = function() {
this.stopdrag();
if (eval(this._droptarget) == dropgreghair_mc) {
this._x = dropgreghair_mc._x;
this._y = dropgreghair_mc._y;
sound1.gotoandplay(2);
} else {
this._x = start2x;
this._y = start2y;
}
};
//drag 4
ciaraeyes_movieclip.onrelease = function() {
this.stopdrag();
if (eval(this._droptarget) == dropciaraeyes_mc) {
this._x = dropciaraeyes_mc._x;
this._y = dropciaraeyes_mc._y;
sound1.gotoandplay(2);
} else {
this._x = start3x;
this._y = start3y;
}
};
//drag 4
gregeyes_movieclip.onrelease = function() {
this.stopdrag();
if (eval(this._droptarget) == dropgregeyes_mc) {
this._x = dropgregeyes_mc._x;
this._y = dropgregeyes_mc._y;
sound1.gotoandplay(2);
} else {
this._x = start4x;
this._y = start4y;
}
};
reset_mc.onrelease = function() {
gregeyes_movieclip._x = start4x;
gregeyes_movieclip._y = start4y;
ciaraeyes_movieclip._x = start3x;
ciaraeyes_movieclip._y = start3y;
greghair_movieclip._x = start2x;
greghair_movieclip._y = start2y;
ciarahair_movieclip._x = start1x;
ciarahair_movieclip._y = start1y;
}
ive tried things test did work...
if(var start1x:number != ciarahair_movieclip._x){
gotoandstop(24);
}
plays right through 24 when export. has any ideas?
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment