trvendetta
🏅Acemi Tasarımcı🏅
- Katılım
- 21 Ara 2009
- Mesajlar
- 60
- Tepkime puanı
- 0
yeni sayfa açıp ilk layer sağ tıkalyıp action aşağıdaki kod yapıştıryoruz ve sayfaya sürükliycemiz neseyi koyutoruz movide clip yapıyoruz f8 basıp yapabilirsiniz ismini yahsibilisim_com yapıyoruz propertiesden.
Kod:
//The x & y coordinates of the top-left corner of the rectangle.
var my_x:int=stage.stageWidth-yahsibilisim_com.width;
var my_y:int=stage.stageHeight-yahsibilisim_com.height;
//The height and width of the rectangle.
var myWidth:int=0-my_x;
var myHeight:int=0-my_y;
//Create a new instance of the rectangle class with the coordinates above.
var boundArea:Rectangle=new Rectangle(my_x, my_y, myWidth ,myHeight);
//Adds the mouse down and up event listeners to the sheep movie clip.
yahsibilisim_com.addEventListener(MouseEvent.MOUSE_DOWN, drag);
yahsibilisim_com.addEventListener(MouseEvent.MOUSE_UP, drop);
//This function drags the sheep but limits to the stage boundaries.
function drag(event:MouseEvent):void {
yahsibilisim_com.startDrag(false,boundArea);
}
//This function releases the sheep object.
function drop(event:MouseEvent):void {
yahsibilisim_com.stopDrag();
}