Thursday, January 10, 2013

::LAST WEEK:: Drag and Drop


Salam and hi.. :D
Minggu ni adalah minggu last untuk kuliah..
Untuk authoring system ni, bfore habis kelas kami telah belajar mengenai drag n drop..
Kalau sebelum ni belajar simple ttg drag n drop tp this time blajar advance sikit…
Yang mana aka nada tanda betul jika kita Berjaya drag n drop di tmpat yang betul…
Here the steps~

1.       We have to insert a new symbol and name it as place…
2.       Make sure you choose movie clip as the type of object..
3.       Then make a rectangle at the first frame…
4.       Put this action script on the frame..
Stop();
5.       Insert new key frame at frame 2.. and draw a tick at the corner of the rectangle…
6.       Put the stop action script also on the frame..
7.       Then, back to the scene and drag the place movie clip that we create on the stage…
8.       Insert two new symbols which are rectangle and circle..
9.       Rename them as rec and circle..Again choose movie clip as the type of the symbol..
10.   Then right click on the symbol and insert these below action script for the rectangle..

on(press){
startDrag(this);
}
on(release){
stopDrag();
if((this._x>=378.4)&(this._x<=427.8)&(this._y>=195.2)&(this._y<=234.6))
{
_root.box2.gotoAndStop (2);
}else{
_root.box2.gotoAndStop (1);
this._x=93.5;
this._y=117.6;
}
}

111.  And this below action script for circle..

on(press){
startDrag(this);
}
on(release){
stopDrag();
if((this._x>=398.1)&(this._x<=442.8)&(this._y>=281.8)&(this._y<=289.3))
{
_root.box1.gotoAndStop (2);
}else{
_root.box1.gotoAndStop (1);
this._x=112.2;
this._y=179.6;
}
}
12.   Test Movie..

Ini adalah drag n drop yang baru saya create untuk project flash saya~ :D



0 comments:

Powered by Blogger.