View Full Version : drag mc from one scrollpane to another?
mad henkie
05-06-2004, 06:37 AM
Hi all,
is it possible to drag a movieclip from one scrollpane to another? if so, how??
:confused:
CyanBlue
05-06-2004, 09:16 AM
Howdy and Welcome... :)
I don't think it is possible... Maybe I am wrong about that... :)
The only way I could think of doing is to see if you can detect the location of the dragging movieClip within one scrollPane and if it is not within the border, delete it and attach it to the next scrollPane if the mouse is located there... Not sure how easy it will be to program though...
farafiro
05-06-2004, 09:25 AM
just subscribed this thread coz I think it's interesting
but after seeing Cyan's and upon my linited knowledge I don't think it's doable too
CyanBlue
05-06-2004, 09:35 AM
Um... Actually it is doable... I have seen somebody doing it long time ago... I was looking for very same thing at the time, and I didn't felt that it was absolutely necessary to implement that feature, so I didn't go further, but it's gotta be possible... :)
farafiro
05-06-2004, 09:41 AM
well, how can u drag it to the edge then make it like disappear from the first then stick to the mouse and appear in the other
CyanBlue
05-06-2004, 09:45 AM
Well... As I was saying... You'd need to run a routine that checks the location of the mouse and dragging... Have that routine check if the mouse is clicked and dragging and if that's the case, check if the mouse is within the boundary of one scrollPane... If it is at the edge where it is supposed to be coming out of the scrollPane, get rid of the instance from the scrollPane and attach the very same movieClip onto the main timeline and once the mouse is moved to the other scrollPane, delete the instance in the main timeline and attach it again onto the scrollPane... ??? :)
farafiro
05-06-2004, 09:48 AM
theortically, it's easy and in the mind
but then if u r pressing, dragging the instance and stopped moving @ the edge of the pane
where will be the instance??
will it jump off the pane even if its half side inside the pane??
CyanBlue
05-06-2004, 10:23 AM
Just very quick sample...
It just works from left pane to right pane...
I am just checking the _xmouse when dragged, so it won't work if you go downwards... But you get the idea... :)_global.pressed = false;
_global.transferToMain = false;
_global.transferToPane2 = false;
this.test1_sp.setScrollContent("MC_Ball");
ball = this.test1_sp.getScrollContent();
ball.onPress = function ()
{
this.startDrag(true);
_global.pressed = true;
}
ball.onRelease = function ()
{
this.stopDrag();
_global.pressed = false;
}
this.createEmptyMovieClip("test_mc", 1234);
this.test_mc.onEnterFrame = function ()
{
// trace(_global.pressed + " : " + _level0._xmouse + " : " + _level0._ymouse);
if (_global.pressed)
{
if ((_level0._xmouse > 175) && (_level0._xmouse < 225))
{
if (!_global.transferToMain)
{
_global.transferToMain = true;
ball.removeMovieClip();
_level0.attachMovie("MC_Ball", "ball_mc", 9999, {_x:_level0._xmouse, _y:_level0._ymouse});
_level0.ball_mc.startDrag();
}
}
else if ((_level0._xmouse > 275) && (_level0._xmouse < 400))
{
if (!_global.transferToPane2)
{
_global.transferToPane2 = true;
_level0.test2_sp.setScrollContent("MC_Ball");
ball = _level0.test2_sp.getScrollContent();
ball._x = _level0._xmouse - 250;
ball._y = _level0._ymouse - 50;
ball.onPress = function ()
{
this.startDrag(true);
_global.pressed = true;
}
ball.onRelease = function ()
{
this.stopDrag();
_global.pressed = false;
}
ball.startDrag();
_level0.ball_mc.removeMovieClip();
}
}
}
}
farafiro
05-09-2004, 04:05 AM
thx Cyan
CyanBlue
05-09-2004, 12:09 PM
Not a problem man... I was sorta feeling lazy at work, so I made that one real quick... :D
mad henkie
05-10-2004, 02:47 AM
thanx, this will do for me
CyanBlue
05-10-2004, 08:30 AM
Well... I am telling you up front that you've got to add some more conditional statements to get that one working since you cannot move it downward at the moment, for example... But as long as you get the idea, you won't have problem adding that... :)
Hi.
how u can scrolling horizental and vertical while u dragging the movieclip.
need help
thanx
farafiro
05-19-2004, 08:43 AM
http://www.actionscript.org/forums/showthread.php3?p=236689#post236689
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.