LogoLogo
  • Home
  • Projects
  • About
  • Contact

Two Flash Website Generation Tools

Devon O. · July 10, 2008 · AIR, Flash · 12 comments
3

For those of you who regularly use swfobject, expressInstall, and swffit (formerly “fitflash”) for your Flash websites/applications, I just developed a couple tools that will make you love me.

The first is just a simple html template that can be used with Flash. Download the template here and extract the html file to your HTML directory (on a Windows machine that’s at C:\Documents and Settings\[USER]\Local Settings\Application Data\Adobe\Flash CS3\en\Configuration\HTML – mac users are on their own). Now open Flash and go to the HTML publish settings. In the “Template” drop down box, you’ll find one named “SWFObject, SWFfit, and ExpressInstall”. Select that and you’re good to go. A word of advice though – to include a document title and a description in your generated html, in Flash you’ll need to go to “Modify” -> “Document” and set the title and description there. The swffit dimensions will be set according to the dimensions of the .swf file. Long story short, you will generate a .html file that looks like the one below straight out of Flash.

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <!--link rel="shortcut icon" href="favicon.ico"-->
        <meta name="description" content="Coolest gosh darn site." />
        <meta name="keywords" content="" />
        <meta name="author" content="" />
        
        <title>This is my title.</title>
        
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript" src="swffit.js"></script>
        <script type="text/javascript">
            var flashvars = {
            
            };
            var params = {
                width: '800',
                height: '600',
                quality: 'high',
                pluginspage: 'http://www.macromedia.com/go/getflashplayer',
                align: 'middle',
                play: 'true',
                loop: 'true',
                scale: 'showall',
                wmode: 'window',
                devicefont: 'false',
                bgcolor: '#869ca7',
                menu: 'true',
                allowFullScreen: 'false',
                allowScriptAccess: 'sameDomain',
                movie: 'Untitled-1',
                salign: ''
            };
            var attributes = {
            
            };
            swfobject.embedSWF("Untitled-1.swf", "Untitled-1", "800", "600", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
            swffit("Untitled-1", 800, 600);
        </script>
        <style type="text/css">
            body{
                color: #666666;
                background-color: #869ca7;
            }
        </style>
    </head>
    <body>
        <div id="Untitled-1">
            <a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" title="Get Adobe Flash player" /></a><br />
            You need <a href="http://www.adobe.com/go/getflashplayer">Flash Player 9</a> and javascript enabled to see the content of this site.
        </div>
    </body>
</html>

Of course the trouble with that is, you will still have to manually add the swfobject.js, swffit.js, and expressInstall.swf files yourself, and that’s a lot of extra work.

So, for the ultimate in laziness convenience, I came up with the OBO Site GatherAIR (please, god, someone post a comment suggesting a better name – I write code, not copy). As the horrible name implies, the Site GatherAIR is a desktop AIR application that makes your life 100% easier. All you have to do is specify an output directory, then drag and drop a .swf file into the hard-to-miss target area and all javascript, html, and .swf files will be automagically added to the specified directory. The application also allows you to customize the html file to a limited degree by adding a title, author, some keywords, a background color, a description, and whether or not to allow fullscreen or the Flash context menu. None of that html stuff is required though. If left blank, the title will be the same as the name of the .swf file, the background will be a greyish blue (similar to a default Flex background), the fullscreen and menu will both be false and everything else will be left blank. Essentially speaking, you’ll get the same html as posted above.

Here’s what it looks like:

OBO Site GatherAIR screenshot.

The application comes packaged with swfobject version 2.1, swffit version 1.0 and expressInstall whatever version it is. Hopefully, the authors of those fine products aren’t upset by my little redistribution, but they are open source projects and I give the authors (Geoff Stearns, Miller Medeiros, and whoever the hell originally created expressInstall) full credit. Should you use this, though, and need to update the files, navigate to the installation directory, look for a directory named “includes” and replace the three files found there (making sure they still have the same file names!).

This project also makes use of Ben Stucki’s “metaphile” – a nice (though painful to use) package for reading header/metadata info from various file formats.

The current version of OBO Site GatherAIR, 0.5, can be downloaded here.

Looking towards that orgiastic future I believe in, some things I would definitely like to add to this application: more user controlled html settings, more output templates, and, really, the ability for users to add custom templates of their own. But all that takes time, and who has that these days?

Of course for a little bit of bread, I could be easily persuaded to make some time to custom tailor something similar for an individual or company. I’m just sayin’…

  Facebook   Pinterest   Twitter   Google+
  • Rockin and Rollin with the JiglibFlash Terrain
    March 16, 2010 · 8 comments
    2465
    6
    Read more
  • Asdoc GUI and CommandProxy
    June 01, 2008 · 14 comments
    3094
    3
    Read more
  • Beach Ball Kinect Party
    February 15, 2011 · 4 comments
    2247
    5
    Read more
12 Comments:
  1. devon,
    like i said before you are the man! this is great stuff man!

    thanks again,
    -brad

    bradj · July 11, 2008
  2. Great!
    This is a good idea and I will be trying it out. I’ll le tyou know how it goes! =)

    Evan Mullins · July 11, 2008
  3. Thank you for the comments – and Evan definitely let me know how it goes and what needs improved..

    Devon O. · July 12, 2008
  4. Man I told you , Iam a fan of yours, any ways you can name it..

    OBO Publisher

    well imo
    any ways thanks , it gonn asave a lot of time and pain

    Platfuse · July 18, 2008
  5. I tested it and it works like a charm.
    one suggestion though, can you add CSS functionality to this

    Vini

    Platfuse · July 18, 2008
  6. Hey, Vini. Sorry for the delay – you’ll probably never read this, but there are a few other things that I was thinking of adding, so CSS is a definite option for a future release..

    Devon O. · August 14, 2008
  7. Great template! However, I keep getting the ‘flash and javascript’ message instead of my flash content. All the files are where they should be, and my reader is up to date…..what gives?

    Thanks.

    Stephen · August 22, 2008
  8. Stephen, it may be that quite a few of the more recent entries are published to the Flash 10 and require the Flash 10 player (currently only in beta, but still downloadable if you do a quick search). If you do have the v. 10 player installed, I’m not sure what the problem could be. In any case I apologize for the inconvenience. All credit for the template goes to Anthony Baggett (link in the footer). Not only a free template, but he helped me out when I was experiencing some technical difficulty with it. Very nice guy.

    Devon O. · August 22, 2008
  9. Hi
    I had try to download your app to plat with, unfortunately the link is broken….
    Please let me know when you be able to fix the problem .
    I like to try the app it look very interesting..
    Lev

    Lev · September 24, 2009
  10. Hi Lev,

    Sorry about the difficulties. Try downloading from the link on this page: http://blog.onebyonedesign.com/?p=146 That one should work out for you.

    d.

    Devon O. · September 24, 2009
  11. thank you for this great idea :)

    coloriages · October 28, 2010

Leave a Comment! Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Devon O. Wolfgang

AIR | Unity3D | AR/VR

Unity Certified Developer

Technical Reviewer of “The Essential Guide to Flash CS4 AIR Development” and “Starling Game Development Essentials”

Reviewer of “The Starling Handbook”

Unity Engineer at Touch Press.

Categories
  • Actionscript (95)
  • AIR (16)
  • Flash (99)
  • Games (7)
  • Liberty (13)
  • Life (53)
  • Shaders (20)
  • Unity3D (21)
Recent Comments
  • Devon O. on Unity Ripple or Shock Wave Effect
  • Feral_Pug on Unity Ripple or Shock Wave Effect
  • bavvireal on Unity3D Endless Runner Part I – Curved Worlds
  • Danielius Vargonas on Custom Post Processing with the LWRP
  • Luca G on Unity Ripple or Shock Wave Effect
Archives
  • December 2020 (1)
  • December 2019 (1)
  • September 2019 (1)
  • February 2019 (2)
  • December 2018 (1)
  • July 2018 (1)
  • June 2018 (1)
  • May 2018 (2)
  • January 2018 (1)
  • December 2017 (2)
  • October 2017 (1)
  • September 2017 (2)
  • January 2017 (1)
  • July 2016 (1)
  • December 2015 (2)
  • March 2015 (1)
  • September 2014 (1)
  • January 2014 (1)
  • August 2013 (1)
  • July 2013 (1)
  • May 2013 (1)
  • March 2013 (2)
  • December 2012 (1)
  • November 2012 (1)
  • September 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (1)
  • December 2011 (2)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (1)
  • May 2011 (2)
  • April 2011 (2)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (3)
  • October 2010 (5)
  • September 2010 (1)
  • July 2010 (2)
  • May 2010 (5)
  • April 2010 (2)
  • March 2010 (7)
  • February 2010 (5)
  • January 2010 (5)
  • December 2009 (3)
  • November 2009 (1)
  • October 2009 (5)
  • September 2009 (5)
  • August 2009 (1)
  • July 2009 (1)
  • June 2009 (2)
  • May 2009 (6)
  • April 2009 (4)
  • March 2009 (2)
  • February 2009 (4)
  • January 2009 (1)
  • December 2008 (5)
  • November 2008 (2)
  • September 2008 (1)
  • August 2008 (6)
  • July 2008 (6)
  • June 2008 (9)
  • May 2008 (4)
  • April 2008 (3)
  • March 2008 (4)
  • February 2008 (9)
  • January 2008 (7)
  • December 2007 (6)
Copyright © 2017 Devon O. Wolfgang