Hi,
I have a MC which contains three elements: drag_mc, a button which removesMovieClip and test_mc (resizes the whole MC) which also hosts a button called resizeBtn.
This is the code I’m using which will resize the clip, make it draggable and remove it. Problem is that the remove_btn either doesn’t remove the whole clip or doesn’t ‘move’ with the rest of the clip. Hope that makes sense?
test_mc code:
ActionScript Code:
[LEFT][COLOR=#0000FF]onClipEvent[/COLOR] [COLOR=#000000]([/COLOR]enterFrame[COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR]pressing == [COLOR=#000000]true[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]textbox[/COLOR].[COLOR=#0000FF]_width[/COLOR] = [COLOR=#0000FF]_x[/COLOR] + [COLOR=#000080]22[/COLOR];
[COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]textbox[/COLOR].[COLOR=#0000FF]_height[/COLOR] = [COLOR=#0000FF]_y[/COLOR] + [COLOR=#000080]22[/COLOR];
[COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]drag_mc[/COLOR].[COLOR=#0000FF]_y[/COLOR] = [COLOR=#0000FF]_y[/COLOR] + [COLOR=#000080]25[/COLOR];
[COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]remove_btn[/COLOR].[COLOR=#0000FF]_x[/COLOR] = [COLOR=#0000FF]_x[/COLOR] + [COLOR=#000080]22[/COLOR];
[COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]drag_mc[/COLOR].[COLOR=#0000FF]_x[/COLOR] = [COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]textbox[/COLOR].[COLOR=#0000FF]_width[/COLOR] / [COLOR=#000080]2[/COLOR];
[COLOR=#000000]}[/COLOR] [COLOR=#808080]*// end if*[/COLOR]
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000FF]_parent[/COLOR].[COLOR=#000080]dragging[/COLOR] == [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#000000]}[/COLOR] [COLOR=#808080]*// end if*[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
inside test_mc is a resizeBtn:
ActionScript Code:
[LEFT][COLOR=#0000FF]on[/COLOR] [COLOR=#000000]([/COLOR]press[COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
pressing = [COLOR=#000000]true[/COLOR];
[COLOR=#0000FF]startDrag[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]this[/COLOR], [COLOR=#000000]false[/COLOR], [COLOR=#000080]130[/COLOR], [COLOR=#000080]35[/COLOR], [COLOR=#000080]9999[/COLOR], [COLOR=#000080]9999[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#0000FF]on[/COLOR] [COLOR=#000000]([/COLOR]release, releaseOutside[COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
pressing = [COLOR=#000000]false[/COLOR];
[COLOR=#0000FF]stopDrag[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
remove_btn uses this code:
ActionScript Code:
[LEFT][COLOR=#0000FF]on[/COLOR] [COLOR=#000000]([/COLOR]press[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
Thank you.