الأحد، ١٧ أكتوبر ٢٠١٠

اكشن سكريبت 3:كود لجعل العناصر قابله للسحب والإسقاط

//Array to hold all the puzzle movie clip instances.

var burgerArr:Array = new Array (burger_mc, burger2_mc, burger3_mc,
burger4_mc, burger5_mc, burger6_mc, burger7_mc);

//For loop to control the drag and drop of each burger by adding a
//mouse up and down to each movie clip.
for (var i:uint =0; i < burgerArr.length; i++) {
burgerArr[i].addEventListener(MouseEvent.MOUSE_DOWN, drag);
burgerArr[i].addEventListener(MouseEvent.MOUSE_UP, drop);
}

//This function drag the movie clips when the mouse is pressed.
function drag(event:MouseEvent):void {
event.currentTarget.startDrag();
}

//This function drop the movie clips when the mouse is released.
function drop(event:MouseEvent):void {
event.currentTarget.stopDrag();
}

هناك تعليق واحد:

ilike2 يقول...

This is to advise you that you are using copyrighted and protected material on your blog. Your illegal use of my articles at: http://nezar71.blogspot.com/2010/10/array-to-hold-all-puzzle-movie-clip.html is originally from my blogs at: ilike2flash.com.
This is original content and I am the author and copyright holder. Use of copyright protected material without permission is illegal under copyright laws.
Please take one or more of the following actions immediately:
• Provide compensation for use of my copyright protected material of up to $100,000
• Remove the plagiarized material immediately.
I expect a response within 5 days to this issue. Thank you for your immediate action on this matter. If you do not response Google Adsense will be notify of copyright violation.

إرسال تعليق

 
;