พอดีกำลังทำเกมส์โดยใช้โปรแกรม Adobe Flash ค่ะ โดยศึกษาจากคลิปนี้ค่ะ
https://www.youtube.com/watch?v=YBSOs5IXwDA
ติดปัญหาตรงโค้ดนี้ค่ะ
[code]score = 0;
counter = 0;
function myDrag() {
this.pointx = this._x;
this.pointy = this._y;
this.depth_old = this.getDepth();
this.startDrag();
this.swapDepths(getNextHighestDepth());
}
aa2.onPress = myDrag;
aa2.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc2) {
this.x = root.cc2_x;
this.y = root.cc2_y;
feed2.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed2.gotoAndStop(3);
}
};
aa4.onPress = myDrag;
aa4.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc4) {
this.x = root.cc4_x;
this.y = root.cc4_y;
feed4.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed4.gotoAndStop(3);
}
};
aa1.onPress = myDrag;
aa1.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc1) {
this.x = root.cc1_x;
this.y = root.cc1_y;
feed1.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
removeMovieClip(drop1);
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed1.gotoAndStop(3);
}
};
aa5.onPress = myDrag;
aa5.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc5) {
this.x = root.cc5_x;
this.y = root.cc5_y;
feed5.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed5.gotoAndStop(3);
}
};
aa3.onPress = myDrag;
aa3.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc3) {
this.x = root.cc3_x;
this.y = root.cc3_y;
feed3.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed3.gotoAndStop(3);
}
};[/code]
คำถามคือ จะแก้ไขโค้ดนี้ที่เป็น action skip 2 ให้เป็น action skip 3 หรือให้ run ในคำสั่งaction skip 3 ทำยังไงคะ
รบกวนสอบถามผู้มีความรู้เกี่ยวกับโปรแกรม Adobe Flash ค่ะ
https://www.youtube.com/watch?v=YBSOs5IXwDA
ติดปัญหาตรงโค้ดนี้ค่ะ
[code]score = 0;
counter = 0;
function myDrag() {
this.pointx = this._x;
this.pointy = this._y;
this.depth_old = this.getDepth();
this.startDrag();
this.swapDepths(getNextHighestDepth());
}
aa2.onPress = myDrag;
aa2.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc2) {
this.x = root.cc2_x;
this.y = root.cc2_y;
feed2.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed2.gotoAndStop(3);
}
};
aa4.onPress = myDrag;
aa4.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc4) {
this.x = root.cc4_x;
this.y = root.cc4_y;
feed4.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed4.gotoAndStop(3);
}
};
aa1.onPress = myDrag;
aa1.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc1) {
this.x = root.cc1_x;
this.y = root.cc1_y;
feed1.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
removeMovieClip(drop1);
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed1.gotoAndStop(3);
}
};
aa5.onPress = myDrag;
aa5.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc5) {
this.x = root.cc5_x;
this.y = root.cc5_y;
feed5.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed5.gotoAndStop(3);
}
};
aa3.onPress = myDrag;
aa3.onRelease = function() {
this.stopDrag();
this.swapDepths(this.depth_old);
if (eval(this._droptarget) == cc3) {
this.x = root.cc3_x;
this.y = root.cc3_y;
feed3.gotoAndStop(2);
counter += 1;
score = score+1;
if (counter == 5) {
scoreshow.text = score;
}
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
} else {
this.x = this.pointx;
this.y = this.pointy;
feed3.gotoAndStop(3);
}
};[/code]
คำถามคือ จะแก้ไขโค้ดนี้ที่เป็น action skip 2 ให้เป็น action skip 3 หรือให้ run ในคำสั่งaction skip 3 ทำยังไงคะ