Flash as3 dragging Movieclips from Scrollpane component into a movieclip/stage
Hi im new on this board hope you can help me.
Im trying to make a flash map game.Now i have got items in a Movieclip and want this Movieclip into a scrollpane component but i have got probs cause the dragging dont go outside of the scrollpane.
Here is my Code
container.mc_item.buttonMode = true;
container.mc_item.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
function onDown(event:MouseEvent):void {
container.mc_item.startDrag();
}
container.mc_item.addEventListener(MouseEvent.MOUSE_UP, onUp);
function onUp(event:MouseEvent):void {
container.mc_item.stopDrag();
trace(container.mc_item.dropTarget.parent.name); // this is the command that tells us which area the mc_item was dropped on
}
container.scrollpane.source= container.mc_item;
Please help
I uploaded the source in cs4. Would be great if you can make the each dynamic _mc in scrollpane dragable, to drag into the movieclip outside. Is it possible to give eac开发者_如何转开发h of the _mc in the scrollpane a label?
http://www.speedshare.org/download.php?id=5324318F11
Thanks
I think you either need to write your own scroll-pane component, or (easier I think), add some code so that when you start dragging the item in the list, you create a duplicate of the item instead (which is not added as a child to the scrollpane), and drag that instead. Don't forget to remove it when you drop it :)
精彩评论