1st question [Archive] - XML Elves

1st question

Andres
02-12-2009, 10:42 AM
Hi folks,

I am new to SVG and am trying to get up to speed with it--I have a few questions.

Q1: how do I combine basic objects to form a composite object that I can deal with as a single object?

I have a simple circle with a guassian filter to blur the circle. Then I have a similar circle that is displayed over the blured circle for a drop shadow of the colored circle. I have both of these <circle ....> in a group like:
<g onmousedown..... onmousemove.... onmouseup.... >
<circle ....> with blur
<circle ....> regular circle with out blur filter
</g>

Now I do a transformation so I can move this composite object. But only the regular circle (the 1st circle) moves, that is, the blurred circle or the drop shadow does not move with the regular circle. Once I move the regular circle and expose the blurred shadow, I can move it. But they do not move as a single, combined object.

So, my 1st question is how do I combine objects to create composite objects that can be dealt with as a single object?

Q2: If my circle is small and I am trying to move it, if I move the mouse too fast the curzer moves out of the circle and the circle stops. I have an onmouseup event that sets a variable to false that stops the movement (as a number of the tutorial examples show). But this is problematic when the object is small because of the movement of the mouse.

So, what is a better technique for moving small objects with the mouse?

Thanks,

-Andres

Andres
02-13-2009, 09:44 AM
OK...I like talking to myself :-)

I have found the answer to my first question.

If I group my composite object within <defs> it all works as expected. I did not have my groups (<g>.>>...</g>) within <defs>....</defs>. Now that I put them within the <defs> it works.

SVG is really cool---I like this.

-Andres

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum