Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-28-2003, 06:13 PM   #1
Ledge
Registered User
 
Join Date: Feb 2002
Posts: 69
Default Drag and Drop from a Scrollpane...

Does anyone know if it is possible to do a drag and drop from a scrollpane? I have been trying for a little while now to get it to work, and I can't quite get it to work.

I have a menu that scrolls left to right with icons in it. The MC on its own outside of the scrollpane works just as it is supposed to, whenever I put it in the scrollpane I can't click on any of the items to drag them.

Here is some of the AS i am using:
ActionScript Code:
myScrollPane.face_mc.alien1_mc.onPress = function (){            this.startDrag(true);         frame = 3;         Xcors = this._x;         Ycors = this._y;            }; myScrollPane.face_mc.alien1_mc.onRelease = function (){         stopDrag();             box_drop=this._droptarget.substr(0,8);             if(box_drop=="/body_mc"){                     body_mc.head_mc.gotoAndStop(frame);                  }         this._x = Xcors;         this._y = Ycors;     };
MyScrollPane is the ScrollPane, Face_MC is the MC that contains all of the different menu opitons and alien1_mc is the first menu option. I am sorry, but I can't post the FLA here for viewing.

Thanks in advance,
Ledge

Last edited by CyanBlue; 02-22-2005 at 01:20 AM. Reason: AS tag is applied...
Ledge is offline   Reply With Quote
Old 04-28-2003, 06:24 PM   #2
Ledge
Registered User
 
Join Date: Feb 2002
Posts: 69
Default

By looking at some of the other posts on here I was able to figure out that this AS works, but it only lets me move items around in the ScrollPane, when I try to move them out of the ScrollPane they disappear, I am guessing this is because of the Mask. Does anyone know how to deal with the Mask on a Component?

This was the AS that partially worked:

ActionScript Code:
myScrollPane.tmp_mc.alien1_mc.onPress = function (){                this.startDrag(true);         frame = 3;         Xcors = this._x;         Ycors = this._y;            };

Last edited by Ledge; 04-28-2003 at 06:27 PM.
Ledge is offline   Reply With Quote
Old 04-28-2003, 06:32 PM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy...

I think that goes more to the existance of the movieclip that you are draggin from the scrollpane instance...

Maybe you can duplicate the movieclip that you are dragging as soon as the _xmouse and _ymouse goes out of the scrollpane aread and use that one???

I had similar one a while ago, and it wasn't successful to me...
You gotta let me know if you get yours working, right???

Maybe there is other way to do it... But I don't know...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-28-2003, 07:29 PM   #4
Ledge
Registered User
 
Join Date: Feb 2002
Posts: 69
Default

I think I figured out a way to do it. What I am doing is attaching a MC to the mouse whenever you click on the stage, the first frame is blank so it can't be seen. When you click on an item in the scrollpane it jumps to a specific frame that is in the MC that is attached to the mouse. The MC that gets attached has all the same icons used in the scrollpane.

This is the code on the MC that gets attached to the mouse when the mouse button is pressed and when it is released:
ActionScript Code:
onClipEvent (mouseDown) {         startDrag("", true);        } onClipEvent (mouseUp) {     this.gotoAndStop(1);     box_drop=this._droptarget.substr(0,8);             if(box_drop=="/body_mc"){                     _root.body_mc.head_mc.gotoAndStop(_root.frame);                  } }

This is the code on the main timeline that detects what button you are clicking in the scrollpane and tells it what frame to jump to:

ActionScript Code:
face_mc.tmp_mc.alien1_mc.onPress = function (){         frame = 3;         _root.mousedrag1_mc.gotoAndStop(frame);       };

This all seems to work fine for me and it seems to do what I need it to do. I hope this helps with your problem as well. Thanks.
Ledge is offline   Reply With Quote
Old 04-28-2003, 07:52 PM   #5
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Yes... That'll do the same thing that I have mentioned with the duplicate movieclip stuff, I guess...

What I wanted to do was to click on one of those many buttons in one scrollpane and drag it and drop in the specific place in another scrollpane... I tried it with the duplicateMovieClip() function, but somehow it didn't work right...
So, what I did was to attach a new movieclip on the destination scrollpane when one of those menu items in the scrollpane has been pressed...

One more step it was, but it kinda worked... I'll try what you have next time when I revise the program...
Thanks for letting me know...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-28-2003, 10:16 PM   #6
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,254
Default

Check out this: DeluxTree V6.1.

Not sure if it's what you are looking for but it's pretty damn nice...
__________________

komielan.com
red penguin is offline   Reply With Quote
Old 04-28-2003, 11:24 PM   #7
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Thanks for the link, red penguin...

Yeah... I remember that component... I think I have seen the prototype of this a while ago, and it is nice to see this again in the fully working form...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 11-09-2004, 11:36 PM   #8
zedtag
Registered User
 
Join Date: Nov 2004
Posts: 8
Default

Ledge,

Do you have a fla with the code you have developed. I would like to see it in action as I am having trouble getting it to work on my end.

Best,
zedTag
zedtag is offline   Reply With Quote
Old 11-10-2004, 08:22 PM   #9
zedtag
Registered User
 
Join Date: Nov 2004
Posts: 8
Default HELP! How do I copy and then specify current x, y coords onto a duplicated mc?

Problem:
I am duplicating a mc from a scrollpane to the _root level. This allows me to have drag and drop functionality outside of the scrollpane. The problem I have now is that I am not sure how to specify the current x, y coords of the original mc within the scrollpane.

note: I am duplicating a mc outside of the scrollpane, because the scrollpane does not allow me to drag and drop outside of the scrollpane.

How can I get x, y coords from a movie within a scrollpane? I need these coordinates to tell a duplicated mc where to land.
zedtag is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:33 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.