jingle
04-11-2005, 05:23 PM
Hello. I have a matching game with some drag and drop clips. When all the mc's are matched up correctly, the movie goes to the next frame where there is a play again button. When this button is clicked the movie returns to the first frame. The actionsript on this button sets up the properties so that the movie clips return to their origingal positions. The problem is that the clips are no longer draggable. And ideas how to fix this?
Here is the code from one of the clips.
onClipEvent (load) {
white_x = getProperty(this, _x);
white_y = getProperty(this, _y);
}
onClipEvent (enterFrame) {
this.onRelease = function() {
_root.tries++;
if (hitTest(_root.answer2)) {
_root.answer2;
setProperty(this, _x, white_x);
setProperty(this, _y, white_y);
this._x = _parent.answer2._x;
this._y = _parent.answer2._y;
_root.s_check._visible = true;
_root.score++;
this.enabled = false;
} else {
setProperty(this, _x, white_x);
setProperty(this, _y, white_y);
}
};
}
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();}
And this code is on frame 1 of the main timeline:
stop ();
this.onEnterFrame = function() {
if (_root.score == 8) {
delete(this.onEnterFrame);
gotoAndStop(2);
}
};
Thanks!
Here is the code from one of the clips.
onClipEvent (load) {
white_x = getProperty(this, _x);
white_y = getProperty(this, _y);
}
onClipEvent (enterFrame) {
this.onRelease = function() {
_root.tries++;
if (hitTest(_root.answer2)) {
_root.answer2;
setProperty(this, _x, white_x);
setProperty(this, _y, white_y);
this._x = _parent.answer2._x;
this._y = _parent.answer2._y;
_root.s_check._visible = true;
_root.score++;
this.enabled = false;
} else {
setProperty(this, _x, white_x);
setProperty(this, _y, white_y);
}
};
}
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();}
And this code is on frame 1 of the main timeline:
stop ();
this.onEnterFrame = function() {
if (_root.score == 8) {
delete(this.onEnterFrame);
gotoAndStop(2);
}
};
Thanks!