Neler yeni

Yeni mesajlar Yeni konular En çok mesaj En çok tepki En çok görüntülenen

Flash sürükle bırak

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();
}
 

Benzer konular

AyseV

🌟Usta Tasarımcı🌟
Katılım
22 Ara 2009
Mesajlar
299
Tepkime puanı
7
tesekkur ederim denedim oldu, isime yarayacak :)
 

stajer33

🌱Yeni Üye🌱
Katılım
22 Ocak 2009
Mesajlar
23
Tepkime puanı
0
dahaa kolay bir yolu var bence umarım yararlı olur


on(press){
startDrag(this);
}
on (release) {
stopDrag();
}
 

d3niz

UI Pilot
♾️Grafik Gurusu♾️
Katılım
30 Tem 2008
Mesajlar
1,495
Tepkime puanı
32
Web sitesi
www.d3niz.com
dahaa kolay bir yolu var bence umarım yararlı olur


on(press){
startDrag(this);
}
on (release) {
stopDrag();
}

AS3.0 da bu şekilde çalışmaz. Listener yazıp, fonksiyon çağrılmalı. Diğer kodda sahne alan kontrolü var. :wink:
 

stajer33

🌱Yeni Üye🌱
Katılım
22 Ocak 2009
Mesajlar
23
Tepkime puanı
0
pardon konuyu takip etmemiştim :D uyardığın için sağol dostum
 
Üst