--- In svg-developers@yahoogroups.com, Cameron McCormack <c...@...> wrote: > > huangshan04: > > Does anybody know how to embed a swf file in a svg document? > > What element should be used? > > I donât know of any user agent that supports rendering WMF inside SVG. > If your SVG user agent supported WMF natively, you should be able to do: > > <svg â¦> > <image xlink:href='file.swf' width='100' height='100'/> > </svg> > > If your SVG user agent supports WMF in HTML somehow, then you might be > able to do: > > <svg â¦> > <foreignObject width='100' height='100'> > <object xmlns='http://www.w3.org/1999/xhtml' > data='file.swf' > style='width:100px;height:100px'/> > </foreignObject> > </svg> > > You probably will have better luck if you convert your WMF to SVG, for > example by using Batikâs WMFTranscoder class: > > http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/transcoder/wmf/tosvg/WMFTranscoder.html > > I donât think it is exposed through the command-line transcoder > application yet, unfortunately. > > > Thanks and happy new year. > > æ°å¹´å¿«æ¨! > > -- > Cameron McCormack â http://mcc.id.au/ >
This was about Shockwave Flash, not Windows Metafile. No user agent supports swf natively. Answer number two, an xhtml object tag inside a foreignObject tag is correct. If supported by the user agent this gives us the full power of plugin technology we can use in HTML. But I don't suppose that foreignObject would work if the SVG user agent is itself a plugin, so this wouldn't work in Internet Explorer. All the major browsers with native SVG support do support foreignObject. Theoretically, the image tag, or in SVG 1.2 the animation tag, does not need to rely on native support. They could reference anything, and user agents are free to use plugins for rendering whatever they reference. I don't know for sure, but I don't think browsers do this yet, so we'll have to use foreignObject and the xhtml object tag. But that's just an overtly complicated way of writing answer number one. Note the redundancy. Width and height are set in both the svg:foreignObject element, and the xhtml:object element. One could use an XSL Transformation to automatically replace image and animation elements with xlink:type="application/x-shockwave-flash" with the foreignObject + xhtml:object solution. Conversion to SVG is also an option. I'm sure there exist projects working at SWF to SVG conversion. Translating all script and animation would be a lot, however. If working conversion tools exist, they are probably very limited. Regards Frank ------------------------------------ ----- To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -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/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:svg-developers-dig...@yahoogroups.com mailto:svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/