flash actionscript:
[quoted text, click to view] "Esha_K" <webforumsuser@macromedia.com> wrote in message
news:dmvf8a$5fh$1@forums.macromedia.com...
> Hello everyone...
> 2) can i have buttons in a movieclip that would work in the main
> timeline when
> an instance is dragged on to stage.
I can answer this one question for you. Hopefully others will have
time to answer the others.
To have buttons work within a draggable movieclip you need to avoid
giving mouse click (onPress) events to both. For it to work you can
use onClipEvents for dragging the movieclip and use onRelease for the
buttons like this...
This example has a movieclip with an instance name of mc1 and buttons
inside of it with instance names of b1 and b2.
// code for the draggable movieclip:
//************************************
onClipEvent (mouseDown)
{
if (hitTest(_root._xmouse, _root._ymouse, true))
this.startDrag(); // start dragging the movieclip
}
onClipEvent (mouseUp)
{
stopDrag();
}
onClipEvent (mouseMove)
{
updateAfterEvent(); // smoother looking
}
//************************************
// code for buttons.. (don't attach to anything)
// put the code in the root.
// 2 buttons inside of movieclip mc1 with instance names of b1 and b2
_root.mc1.b1.onRelease=function()
{
// do something with this button
}
_root.mc1.b2.onRelease=function()
{
// do something with this button
}
//************************************
Hope that helps
tralfaz