Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : Drag: Window/Button (Parent/Child)


ecsurfer
6/10/2004 10:14:50 PM
I've tried doing this on my own, went to Google etc. When all else fails, ask
for help? I have a dragable 'windowMC' with a 'closeButton' layer to unload
the movie. The popup window loads into a Main.swf (no problem here so far) but
the Button wont drag with the MC. I assume this is a 'Parent Child' or
'Nesting' issue? I've only been using Flash for a couple of months, so this is
over my head.

Also, I'm not sure how to add X and Y coordinates to contain the dragging
space?

on (press) {
startDrag(this);
}
on (release) {
stopDrag();
}

AS class' cant come fast enough!
-Pete
goseta
6/10/2004 11:56:34 PM
well I think you have to put the close button inside the windowmc movie clip,
so when you set the startDrag action for the window movie (this) you will drag
the movie and all their content including the close button .)
ecsurfer
6/11/2004 2:57:52 PM
ecsurfer
6/14/2004 7:36:02 PM
Fixed! Here is my code for the Drag

onClipEvent (mouseDown) {
this.startDrag(true, 100, 100, 600, 400);
}
onClipEvent (mouseUp) {
this.stopDrag();
}

As far as the button goes... Being a newbie I didnt understand the hierarchy
standards (root, mc, button, etc.) Now I do! I simply put the Button inside the
MC... Duhh! So all is good and I learned alot, thanks for all the help everyone!

AddThis Social Bookmark Button