Catttdaddy
02-24-2011, 01:26 PM
Ok I am trying to make a dragable window like in Windows.
Only the top can be dragged.
Ok so I have a window with a movie clip inside to serve as thesection that can be dragged.
Here is the function for the clip
MainWindow.DragTop.addEventListener (MouseEvent.MOUSE_DOWN,dragWindowBar);
function dragWindowBar (event:MouseEvent):void
{
MainWindow.startDrag(false,Bounds);
}
This works great but I wanted to know if I could make a funtion that would work for all windows instead of a new function for every window.
It seems like I should be able to grab the name of the movieclip that the function is called from and use that instead of the instance name of the main movie clip.
something like:
function dragWindowBar (event:MouseEvent):void
{
this.parent.startDrag(false,Bounds);
}
this of course doesnt work, it drags the whole movie around but it should be a command to just drag the MainWindow...
Thanks for your help in advance. :)
Only the top can be dragged.
Ok so I have a window with a movie clip inside to serve as thesection that can be dragged.
Here is the function for the clip
MainWindow.DragTop.addEventListener (MouseEvent.MOUSE_DOWN,dragWindowBar);
function dragWindowBar (event:MouseEvent):void
{
MainWindow.startDrag(false,Bounds);
}
This works great but I wanted to know if I could make a funtion that would work for all windows instead of a new function for every window.
It seems like I should be able to grab the name of the movieclip that the function is called from and use that instead of the instance name of the main movie clip.
something like:
function dragWindowBar (event:MouseEvent):void
{
this.parent.startDrag(false,Bounds);
}
this of course doesnt work, it drags the whole movie around but it should be a command to just drag the MainWindow...
Thanks for your help in advance. :)