Advertisement

04.13.2008 at 08:47AM PDT, ID: 23318621
[x]
Attachment Details

add buttons to a drag n drop mc

Asked by Dreammonkey in Macromedia Flash

Tags: Macromedia Flash, actionscript 2

I'm making a website in Flash. I'm also making a musicplayer in it.
What I want to do is put the controls for the mp3-player in a container-movieclip that is dragable...
Problem is that the onrelease functions for the (play, stop, ... ) buttons are overwritten by the onRelease function (drag and drop) that I attached to the (container-)mc containing the buttons...
Could there be a solution to this?

I tried putting the drag and drop code in a separate class, hoping that would solve things, which it obviously didn't ...
I also tried making the play, stop buttons dynamic, this enables their onRelease behaviour but doesn't make them get dragged along with the container

any solutions experts?

regards,
D
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
// the drag n drop Class:
class dragDrop extends MovieClip {
	
	public function dragDrop() {
		this.onPress = function(){
			startDrag(this,false,0,0,500,500) // left, top  ; right ; bottom
		} 
 
		this.onRelease = function(){
			this.stopDrag();
		}
 
		this.onReleaseOutside = function(){
			this.stopDrag();
		}
	}
}
 
//code for the play/stop button
trace("playStop depth = " + playStop.getDepth());
trace("playPlay depth = " + playPlay.getDepth());
for (var i=0 ; i<=1; i++){
	playStop = playPlay.attachMovie("playStop" , "playStop", getNextHighestDepth());
	playStop._x = +10;
	playStop._y = +10;
	playStop.onRelease = function(){
		trace("You just pressed the white square")
	}
}
[+][-]04.13.2008 at 09:23PM PDT, ID: 21347514

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Macromedia Flash
Tags: Macromedia Flash, actionscript 2
Sign Up Now!
Solution Provided By: kishoregp
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.14.2008 at 07:51AM PDT, ID: 21350491

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 10:46AM PDT, ID: 21352033

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 04:41AM PDT, ID: 21357683

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628