how do I make a .swf file work in able commerce

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
VetShop
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Tue Jun 26, 2012 11:05 pm

how do I make a .swf file work in able commerce

Post by VetShop » Wed Nov 21, 2012 8:53 pm

Can someone please give me a "how to" from start to finish of using a swf file on our able commerce website?

mouse_8b
Commander (CMDR)
Commander (CMDR)
Posts: 115
Joined: Mon Oct 11, 2010 1:21 pm
Location: Austin, TX
Contact:

Re: how do I make a .swf file work in able commerce

Post by mouse_8b » Mon Dec 03, 2012 6:07 pm

Short answer:
1) http://embed-swf.org/
2) Take the <script> tags from the output and put them in the HTML Head section of an AC page, and put the <div> from the <body> tag into the Description field in AC.

Long Answer:
I'll give this a shot. This won't be a start to finish guide, but it hopefully you'll get the basics down and can come back with specific questions. And I have not personally tried these methods, but this seems to be the current consensus on the internet. This also assumes that the Flash file you want to play will be hosted on your server. If you are linking to a Flash file on another server, you can also use an <iframe>, which may or may not make things easier.

In theory, you only need a properly formed <embed> or <object> tag in the page and everything would work. These two code blocks would work the same, in theory.

Code: Select all

<embed src="helloworld.swf"> 

Code: Select all

 <object width="400" height="400" data="helloworld.swf"></object> 
However, it gets tricky when you want that to work on every browser and operating system. Since <embed> is an older tag that was not recognized until a standard tag until recently, older browsers may not process the tag correctly. <object> was the standard for a while, but not every browser implemented it correctly. This led to people using both <embed> and <object> in the same page to show Flash files, much to the confusion of everyone.

Now we have HTML5. Both <embed> and <object> are standard tags, so up-to-date browsers should process them correctly. However, older browsers may not interpret them right.

Fortunately, some very smart people have put together javascript libraries that will make sure that your Flash file will play on any browser. Some other smart people also put together an easy webpage that you simply fill in the blanks and it outputs all the code you need to play the Flash file.

http://embed-swf.org/ looks like the easiest way to get the HTML and javascript needed
http://code.google.com/p/swfobject/ is Google's answer to the problem.
http://revoltpuppy.com/txp/articles/4/o ... g-to-html5 - Blog article about embed vs object

Making it work in AbleCommerce
As you could probably guess, simply copying and pasting the HTML and javascript from Embed-SWF.org into an AC webpage is not going to work, but it isn't much more difficult. Take the <script> tags from the output and put them in the HTML Head section of an AC page, and put the <div> from the <body> tag into the Description field in AC. That should be it.

Post Reply