Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Install and use built Shumway from Bower

Yury Delendik edited this page Mar 4, 2015 · 1 revision

Installing pre-build Shumway components

In folder of the newly created web application, run:

bower install shumway-dist

It shall install the shuobject.js script at bower_components/shumway-dist location.

HTML code

Create a web page (e.g. demo.html) that includes shuobject.js:

    <script src='./bower_components/shumway-dist/shuobject.js'></script>

and, in a JavaScript, instantiate SWF file viewer similar to swfobject:

    shuobject.embedSWF('demo.swf', 'mainSWF', 800, 512, '9,0,10');

where mainSWF is a div element/container on the web page.

You shall have something like:

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>Basic shuobject demo</title>
  <script src="./bower_components/shumway-dist/shuobject.js"></script>
  <script>
    // Create/embed SWF movie.
    shuobject.embedSWF('demo.swf', 'mainSWF', 800, 512, '9,0,10');
  </script>
</head>
<body>
  <h1>Demo</h1>

  <div id="mainSWF">Flash will be loaded here (it is similar to swfobject)</div>
</body>
</html>

Also add demo.swf file (e.g. from http://mozilla.github.io/shumway/demo.swf)

Viewing a SWF

Use a web server to view the created above page.