Once sXBL is available, it might help with situations like this. It is yet another tool that you can use when you want to create a re-usable template object and then create an instance of it.
Jon ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of svg_tony Sent: Friday, November 11, 2005 11:42 AM To: [email protected] Subject: [svg-developers] Separating shapes and animation (XAML-like) I've toyed around with the way XAML (like SMIL) separates the declaration of shapes and animations using timelines with TargetName or TargetID. There's a number of drawbacks as far as I can see it now if you want to do the same in SVG. I tried these: <?xml version="1.0" encoding="ISO-8859-1"?> <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg"> <defs> <rect x="0" width="50px" height="50px" id="myRectangle" fill="green"></rect> </defs> <use xlink:href="#myRectangle"> <animateColor attributeName="fill" from="blue" to="red" begin="0s" dur="6s" repeatDur="indefinite" /> </use> <defs> <rect x="100" width="50px" height="50px" id="myRectangle2"></rect> </defs> <use xlink:href="#myRectangle2"> <animateColor attributeName="fill" from="blue" to="red" begin="0s" dur="6s" repeatDur="indefinite" /> </use> <rect x="200" width="50px" height="50px" id="myRectangle3" fill="green"> <animateColor attributeName="fill" from="blue" to="red" begin="0s" dur="10s" repeatDur="indefinite" /> </rect> </svg> Drawback #1: You must put the shape in a <defs>-section, otherwise you end up with a second rectangle because of the <use>-element. Drawback #2: You cannot animate the fill, if the fill is already set on the original rectangle (myRectangle). This does not occur with inline animations, or if the fill is left out in the original. Drawback #3: I saw no way of putting an <animate> into a <defs>- section, then refer to it from an inlined <use>, like: <defs> <animate id="a1" ... /> </defs> <rect> <use xlink:href="#a1" /> </rect> Is there a good solution for this? Thanks, Toine. ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- ________________________________ YAHOO! GROUPS LINKS * Visit your group "svg-developers <http://groups.yahoo.com/group/svg-developers> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/1U_rlB/TM --------------------------------------------------------------------~-> ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

