Drag and Drop Activity
Untuk membuat aktiviti ini, semua yang akan di drag dan tempat yang akan di drop adalah movie clip.
1. Buat movie clip symbol untuk sebuah rectangle box. Pada frame 1, draw a rectangle. Pada frame 2, insert keyframe dan tambah tanda right. Masukkan actionscript stop(); pada kedua-dua frame.
2. Buat movie clip symbol untuk circle dan rectangle.
3. Bina 3 layer.
- Layer Response - mengandungi dua rectangle box daripada (1). Intance namepada rectangle pertama dinamakan sebagai box1 sebagai manakala rectangle kedua dinamakan box2. Masukkan juga arahan dan label setiap rectangle box.
- Layer Circle - mengandungi circle dan rectangle daripada (2) dan Next button.
- Layer Action - Masukkan actionscript stop();
4. Pada belakang movieclip symbol-circle, masukkan actionscript:
on (press) {
startDrag(this);
}
on (release) {
stopDrag();
if ((this._x>=290.0) & (this._x<=360.8) & (this._y>=86.8)& (this._y<=110.0)) {
_root.box1.gotoAndStop(2);
}else {
_root.box1.gotoAndStop(1);
this._x = 55.2;
this._y = 110.0;
}
}
Pada belakang movieclip symbol-rectangle, masukkan actionscript:
on (press) {
startDrag(this);
}
on (release) {
stopDrag();
if ((this._x>=290.0) & (this._x<=349.6) & (this._y>=206.0)& (this._y<=232.6)) {
_root.box2.gotoAndStop(2);
}else {
_root.box2.gotoAndStop(1);
this._x = 46.7;
this._y = 220.2;
}
}
Next button will link us to another .swf file. The .swf file must be located in the same folder with this file. Pada belakang Next button, masukkan actionscript:
on (release) {loadMovieNum("cooking-ratatouille-kitchen.swf",0);