Google Swiffy is a new tool for converting .swf Flash files into HTML animations. I have a demonstration file here
There are some support files and then this code is in the HTML

<script src="http://www.gstatic.com/swiffy/v1/runtime.js"></script>
<script src="http://www.robives.com/swiffy/peaucellier.swiffy"></script>
<script>var stage = new swiffy.Stage(document.body, swiffyobject);</script>
<script>stage.start();</script>

I have tried dropping these lines into a blog entry set as php code input format but nothing shows up. What am I missing?
Thanks in advance :-)

Comments

robives’s picture

I worked it out. I've uploaded the html file output by swiffy to the website then embedded it within an iframe. eg:

<iframe src="/swiffy/ptest.html" width="600" height="350">
Sorry - Your browser doesn't support iFrame
</iframe>
tim416’s picture

It would be interesting to see a feature added to Flash Node or Flash Block that allows for dynamic switching to swiffy content for non flash browsers. I've found that generally flash still runs a little smoother than swiffy content in most browsers.

tim416’s picture

I figured out I can add swiffy content using standard alt content in the object tags. I had thought it only worked with text and images.

ayesh’s picture

Sorry. Bad stuff in bad place.

oshrat’s picture

hi.
i am not a programmer, but i can use / know code a little. i made a file in flash and used google swiffy. the outcome is good, but i want to copy it into a site. my question: how / which part of the code, that google swiffy created, to copy into the web page i want?
thank you
oshrat
skype: oshioren

pwaegemans’s picture

What I did was, include the link to the swiffy library in the head tag of my html.tpl.php template:
<script src="https://www.gstatic.com/swiffy/v5.2/runtime.js"></script>
Download swfobject and link to it in your .info file or as above in the html.tpl.php.
Now you have a lot of control over the fallback.

I created a textfield with full html as it is necessary to integrate all the js and flash.
The js and flash I had to manually put in the files folder for now.

The rendered swiffy object comes in a html file with two scripts:
the actual swiffy object ( a huge svg file) and the script that loads it.
I put the actual swiffyobject into a separate js file because it's so big, it's lagging drupal.

This is the code I integrated into my text field (copied from swfobject and adapted to my taste):

<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="625" height="400">
	<param name="movie" value="/sites/default/files/my_file.swf" />
	<!--[if !IE]>-->
	<object type="application/x-shockwave-flash" data="/sites/default/files/my_file.swf" width="625" height="400">
	<!--<![endif]-->
	<div>
		<script src="/sites/default/files/my_swiffyobject.js" type="text/javascript"></script>
		<h1>Now you can add the alternative code for the swiffy object</h1>
		<div id="swiffycontainer" style="width: 625px; height: 400px">
		</div>

	    <script>
	      
	      var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
	                                   swiffyobject);
	      
	      stage.start();
	    </script>

	</div>
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>

Using flash first and js as the fallback increases performance as flash is still the better choice on platforms that can show it.