Thursday, 4 April 2013

WEEK 8: Drag & Drop Activity

Saya dtg lambat utk kelas petang tadi huhu.. Nasib baik pengetua bagi keluar meeting awal sket, kalau x maybe x dpt la nak men'drag & drop'..tq so much Pn. Sallina.. tq jugak pada Dr. Zaida yg x denda saya sbb dtg lewat hehe..sebab kan dah lewat tadi, so parking pon sesuka hati..maka dapat la saya surat cinta yg terselit cantik kat wiper kereta huk3


So sorry =( ..my mistake huhu.. 
Orait, kelas arini still discuss pasal drag & drop tapi advance sket la compare dgn yang ada dalam apps4 before ni.. Lets check this out =)

1. First, create a movie symbol. Go to 'insert', 'new symbol' and select 'movie clip'.
2. Draw a rectangle in the first frame and insert stop actionscript on the frame.
3. Insert a new keyframe in frame 2 and add stop actionscript on that frame. Put the red line for the correct respon as follows:

4. Go back to scene 1, insert a new layer and name it as 'response'. Drag the rectangle into the stage and name the instance box as box1. Drag the same rectangle again to the stage and name the instance name as 'box2'.
5. Insert a new layer and draw/import images in the same layer and convert the images to 'movie clip' symbol.
6. Insert a new layer and insert stop actionscript.


7. Now, click on the cat symbol and insert the actionscript as below:

on(press){
startDrag(this);
}
on(release){
stopDrag();
if ((this._x>=256.1)&(this._x<=429.9)&(this._y>=245.3)&(this._y<=273.9)){
_root.box2.gotoAndStop(2);
}else{
_root.box2.gotoAndStop(1);
this._x=132.1;
this._y=120.0;
}
}

[x and y values depend on the coordinate of your rectangles' position]


8. Next, click on the flower symbol and insert the actionscript as below:

on(press){
startDrag(this);
}
on(release){
stopDrag();
if ((this._x>=55.4)&(this._x<=225.3)&(this._y>=239.3)&(this._y<=273.9)){
_root.box1.gotoAndStop(2);
}else{
_root.box1.gotoAndStop(1);
this._x=384.9;
this._y=115.9;
}
}

9. For the 'next' button, insert the following actionscript to load your .swf movie into flash.

on(release) {loadMovieNum("video.swf",0);
}


But for my 'next' button, I want it to link to my previous drag & drop movie flash that I already uploaded in SwfCabin.

on(release) {
                getURL("http://www.swfcabin.com/swf-files/1364913896.swf");
          }

10. Save your file and test the movie. Try it yourself ok!

Try to drag and drop here. =D

No comments:

Post a Comment