Embedding SVG without xmlns


(Lucky) #1

Hey, i’ve got a complicated question for the Hype Export.
My ad server doesn’t allow any external links in any of the ads, however in order for SVG from illustrator to run it requires

svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 

So these both are http links and the whole SVG element gets completely deleted because of it, meaning i can never use SVGs with hype and it’s really frustrating. I tried to use SVGZ which doenst contain any mention of http however swapping out the exported SVG with a SVGz doesn’t run in safari/mobile safari. It does run in chrome, but if it doesnt run in safari it wont run on iPad… I tried to edit the export to say

new HYPE_466(d,c,{"0":{p:1,n:"train.svgz",g:"11",t:"image/svg+xml svgz"}},

But it still refuses to work on Safari, it should work fine if i just embed it straight in the page but i can’t do it trough the hype export. Is there any way any of you can think of to embed a SVG without having hard http links into it?

Would be extremely useful to me.

Thanks!


(drewbullen) #2

In my experience, the trick to getting the most out of SVG’s in HYPE is to embed the SVG directly in a blank HYPE element. This works like embedding SVG code directly into a regular web page (instead of using img or object tags). SVG code with the external links removed still works using this method.

Here is a live example displayed in Safari (- with the code also attached below):

InlineSVG.zip (116.7 KB)


#3

You can’t embed an SVGz inline, but you can embed an SVG inline. Here’s an example within a rectangle. No SVGs will need to uploaded:

svg test.zip (15.1 KB)


(Lucky) #4

Oh my god you guys just saved my ass! I can push the engine so much more now, this just passed the QA app without fail. Since as you said it it embeds it into it as if it’s a webpage. This is so fantastic, I can just animate things in flash and export it as svg, copy paste the code into div tags… now this won’t be 500 kb, it will be 120-150kb because that ice cream won’t be png sequences.
Thanks again!


#5

Very cute animation! Hits close to home, since it is super hot and humid here!


(Lucky) #6

Hahah thanks! And its set to Toronto temperature, so it’s also live interactive based on our customer location :slight_smile: Couldn’t do that with flash