robzombie
03-09-2005, 02:34 PM
I am trying to drag and drop a group, by clicking on and moving the top bar (a rect). I am changing the x and y attributes of the rectangle, however since a group doesnt have an x and y attribute how could i get it so all the objects in the group move with the top bar? A simple example of how the group would look. By moving the top rect, i need all the objects in the group to move.
<g id="group" >
<rect x="150" y="85" width="50" height="30" style="fill: #00F"
onmousedown="ClickObj(evt)" onclick="ClickObj(evt)" onmousemove="MoveObj(evt)"
onmouseup="OutOfObj(evt)" onmouseout="OutOfObj(evt)">
</rect>
<rect id="bar" x="150" y="85" width="50" height="10" style="fill: orange"
onmousedown="ClickObj(evt)" onclick="ClickObj(evt)" onmousemove="MoveObj(evt)"
onmouseup="OutOfObj(evt)" onmouseout="OutOfObj(evt)">
</rect>
</g>
Thanks for any help.
<g id="group" >
<rect x="150" y="85" width="50" height="30" style="fill: #00F"
onmousedown="ClickObj(evt)" onclick="ClickObj(evt)" onmousemove="MoveObj(evt)"
onmouseup="OutOfObj(evt)" onmouseout="OutOfObj(evt)">
</rect>
<rect id="bar" x="150" y="85" width="50" height="10" style="fill: orange"
onmousedown="ClickObj(evt)" onclick="ClickObj(evt)" onmousemove="MoveObj(evt)"
onmouseup="OutOfObj(evt)" onmouseout="OutOfObj(evt)">
</rect>
</g>
Thanks for any help.