LogoLogo
  • Home
  • Projects
  • About
  • Contact

Website Generation Tool Take II

Devon O. · December 29, 2008 · AIR, Flash · 53 comments
4

Many moons ago I posted an AIR tool that would allow a user to drag a .swf file into a target area and have it spit out all the javascript, html, etc into a designated output directory. I’m not sure if anyone other than I ever used the thing, but I actually use it constantly at work and it seemed high time for a little update.

Well version 2 is here, and while it has the same bad name (“OBO Site GatherAIR”), it’s much more user friendly. This version now features template html files that can be selected. It ships with three templates (“Basic”, “Fullscreen with SWFFIT” and “Flash Centered in HTML” – personally, I don’t care much for the last as it relies on a table to do the centering. All are standards compliant though). Creating your own templates is a piece of cake. Just create a .html file that you’d like to use as a template and give it a memorable name (the name of the file is what will appear in the templates drop down box). Use the following abbreviatations inside the .html file (check out the included templates for examples of how to use the abbreviations):

C#
1
2
3
4
5
6
7
8
9
10
11
12
$DESC        - description of website
$KEY        - website keywords
$AUTH         - website author
$TITLE         - title of html page
$WIDTH         - width of swf file
$HEIGHT     - height of swf file
$BG         - background color (6 digit hex number)
$MENU         - true or false (whether or not to show the Flash context menu)
$FULLSCREEN    - true or false (whether or not to allow full screen)
$SWF         - name of .swf file
$DIV         - name of div that will house the .swf file
$VERSION     - version of .swf file

Finally, just save the html file inside the “templates” directory that is inside the application’s installation directory. The next time you run the app, your template will be selectable from the drop down menu.

The application comes packaged with swfobject.js v 2.1, swfaddress.js v 2.2, and swffit.js v 2.0 (please, no one sue me). To update to newer versions as they appear, just plunk the newer versions into the “includes” directory inside the installation directory (make sure they have the same name’s as the older versions and overwrite those obsolete ones).

*** UPDATE (30DEC08) ***

Yes, already an update to v 2.1. In the previous version (yesterday’s that is), I was moving the files using the File.copyTo() method. Worked fine, but lacked any feedback and, for large .swf files, you may end up sitting there awhile wondering if anything was actually happening. Now, I’ve switched to transferring the files with File.copyToAsync(). Long story short, once all files have been copied to the output directory, you will receive a nice little “Mission accomplished!” message to let you know everything is done.

A few gotchas to watch out for:

  • Selecting the “fullscreen with swffit” template does not automatically include the swffit.js file – make sure to check the checkbox to include it in the output.
  • When publishing to a full screen site, be sure to set up the .swf’s stage properties accordingly (i.e. set the align, set the scale to no scale, etc.).
  • Also, even though there is a checkbox to  include swfaddress.js, none of the html templates include the swfaddress.js script. You’ll either have to modify the final html file – or create your own template!
  • The width, height, and file version variables are taken directly from the .swf file. If you would like to change these or add a minor version to your html, you’ll have to do so manually.

Below is a screenshot:

If interested you can install the application using the badge below:

Get Adobe Flash player

Or you can download the .air file directly here.

Let me know if you find it useful, create your own templates, or have any ideas for further improvements.

  Facebook   Pinterest   Twitter   Google+
  • Flocking (Steering Behaviour) in 3D
    June 06, 2009 · 5 comments
    3071
    3
    Read more
  • Quick Morse Code Generator
    April 27, 2009 · 6 comments
    4155
    5
    Read more
  • Billboard Transition Effect in Flash Player 10
    August 03, 2008 · 9 comments
    2665
    4
    Read more
53 Comments:
  1. I’ve sent it over to Ajaxian cause it’s awesome!

    David King · January 06, 2009
  2. Bitchin’! Thanks, David…

    Devon O. · January 07, 2009
  3. Nice Devon, I might have to play around with this.

    Scott Rockers · January 21, 2009
  4. Devon,

    I’m a long-time admirer of yours. I started to fool around Flash a year ago, and learned a lot mainly ’cause of you. As a matter of fact, I’d place you as one of my “Gurus”. I’ll try your application and will keep in touch.
    Thanks for sharing your expertise.
    Ed

    Edward Souza · April 30, 2009
  5. Hi Ed,
    Thank you for the kind words. Funny you should just try this out now. I was just planning on updating the app this weekend (fix a small bug, add some new templates and update swfobject and swfaddress). So you might want to hold off – or check back on Monday…
    d.

    Devon O. · April 30, 2009
  6. Thanks for creating this tool! Just found it through Refreshing Apps. Can’t wait to try it out….

    web360 · May 05, 2009
  7. Holy crap! this is incrediably useful. Embedding swfs for proofs and such is a daily work chore that this app will make a pleasure.

    thank you – very cool app!

    samBrown · May 09, 2009
  8. Amazing, Stupendous, tremendous, fantastic,…………I love the Flash community, here the Gurus are real Gurus. They are so nice that I can’t explain. Devon, ;-) difficult to show my happiness here in text, but the thing is just that you are great. I am 20 years old novice and attached with flash on and off from 3 to 4 years. I don’t know a lot but every time I have this feeling that, If I caught in some problem there is no problem because we have such (Devon) mentors. Great Job. I am looking forward for some professional tips to become superhero in Actionscript 3.0, any resources, techniques, tricks and I am also impressed from Gugga framework what you said about it. I am eager to listen from you.

    Thanks
    Take care.

    chand · June 05, 2009
  9. works great! although would rather have a “go” button and an swf file name field instead of just dropping the swf in there… but hey it’s free so not really complaining. thanks!

    Summer · June 11, 2009
  10. Amazing! Really. Thank you for this great Application.

    ZoiX · September 14, 2009
  11. A improvement, could be add Falsh variables generation, including javascript url params reader as flash variables.

    Abel · May 10, 2010
  12. Hi Devon, I ended up on this site after posting a Flash problem up on Kirupa. I got a reply from neys who you had helped back in March and he pointed me to your site.
    Your tool is great and thanks v much for sharing this with us – I’d spent 24 hours trying to figure out how to fix this and 10 mins after visiting your site the problem was fixed.
    Cheers
    Rog

    Roger W · October 09, 2010
  13. Hey Roger, Thanks for the kind words. Glad the app helped you out. Haven’t been over to Kirupa in quite some time, myself. I’ll have to go over and check it out.

    Devon O. · October 09, 2010
  14. Devon,

    This is awesome. I was sitting and struggling with the swffit as the instructions weren’t clear and then I found you app… WORKS GREAT! Good JOB!

    My only suggestion if you ever do any modifying to your application, it would be extremely helpful to be able to set the min and max without going into coding.

    Do you mind if I edit this application? What tool did you use to create it?

    Thanks,
    Steve

    Steve · October 13, 2010
  15. I just reread creating a template and that works great for what I just posted… Very impressed… This app is great.

    Steve · October 13, 2010
  16. Devon… I was trying to get this to work and it seems to work great when I open index.html from a local folder. However, as soon as I post it online, SWFFIT does not operate.

    Is there an area I should key in on? The coding it kicked out is the following and dropping this folder on the server and accessing index.html shows the flash video without the SWFFIT feature.

    Thanks for your input in advanced, I admittedly am about 5 months into working with flash videos so I’d say I am an amateur but would like to learn more like this very valuable SWFFIT feature.

    ADAMS P8-Mod8

    You need The latest Flash Player and javascript enabled to see the content of this site.

    Steve · October 14, 2010
  17. “ADAMS P8-Mod8

    You need The latest Flash Player and javascript enabled to see the content of this site.

    “

    Steve · October 14, 2010
  18. Hey Steve,

    sorry for the difficulty. Since I haven’t updated that software in quite some time, the first thing I would do is make sure all the javascript libraries are up to date. You can find them each easily by a bit of googling. Download the latest stable version of each and add them to the ‘includes’ directory within the application install directory (make sure you keep the same file names and overwrite the files there – you can back them up somewhere if you’d like). If that doesn’t solve the problems you’re having, let me know and I’ll see what other ideas I can come up with.

    d.

    Devon O. · October 14, 2010
  19. Hey Devon,

    swffit.fit which appears on line 34 for me, is called before the flash file loads. As I understand it… when I am opening the index file locally, the flash file loads much quicker. As soon as it is hosted online, it appears the swffit.fit appears to resize the flash video before the flash video is loaded.

    Here is an example at this website:

    http://smmeadia.com/ExpandingSWF/index.html

    This same index file works great when run locally.

    If there is an extra line of code I could inject to that asks to hold off running swffit.fit until the flash video is fully loaded, I believe that would correct the situation.

    However, I’m very new at this… Maybe you would know what line of coding would do that?

    Enjoying your site!
    Thanks,

    Steve

    Steve · November 01, 2010
  20. The advice I received was to use swfobject.addDomLoadEvent(fn)…

    This coding should hold off implementing swffit.fit until the video is loaded.
    I just gotta figure out where to place this in the grand scheme of things and what I need to place inside this function.

    I’m sure you got a enough on you plate Devon but if you are ever available to take a moment to show me how to successfully implement a 5 Mb flash video I would be eternally grateful.

    Your OBO Site GatherAIR seems to work great when index files are accessed locally on my machine, but online the swffit features are ignored.

    Feel free to shoot me an email and I could shoot you the flash file. I got a few hundred files like it and I’ve been charged with figuring out how to get them to work online using something like swffit expanding and shrinking.

    Thanks,
    Steve

    Steve · November 01, 2010
  21. Hey Steve,

    the first thing I’d try is updating the swffit.js file with a version from here: http://swffit.millermedeiros.com/ . In fact, I would update all the .js files that are included. This tool hasn’t been updated in quite some time and I’m sure all the javascript files that come included are fairly out of date.

    Hopefully, just doing that will help out.

    Devon O. · November 01, 2010
  22. Devon,

    Thanks anyway… No dice… I don’t get it. It will resize locally but not when I put it online… It’s very sad… I don’t know if it is because my swf video is too big or what… This problem is kicking my butt big time.

    Sigh.. I may have to manually code in specific sizing buttons which is really going to be a pain. If you’d like to take a look let me know…

    This issue is killer. It blinks the right size for just a moment then when video is 100% loaded it reverts to the swf original publish size.

    Steve · November 01, 2010
  23. I will add… your tool would be a life saver if I could find out what is going wrong… I’m using all the up to date JS files.

    Steve · November 01, 2010
  24. At this point, I’m willing to offer $100 to anyone who could find the error in my coding and fix it so I can implement the fix in the rest of them.

    I’m trying to code a website that has a few hundred of these and I need to figure out what I’m doing wrong.

    SWFFIT Locally = Works Perfect
    SWFFIT Placed online = Unresponsive

    Steve · November 02, 2010
  25. Hey Steve,

    One thing to make sure of when using SWFFit is that the stage.scaleMode property is set to no-scale and the stage alignment is set to top left. It seems when first visiting your example site, when I resize the browser the content scales as well.

    If all else fails, send me the swf (make sure you set the two stage properties first) and I’ll check it out..

    Devon O. · November 02, 2010
  26. Devon,

    I didn’t see your email off hand, so I shot a message to you through your website. I wanted to shoot you the swf file.

    I think my JS is running before my video is fully loaded and that is creating the issues.

    Could you send me your email so that I can shoot you the swf and my index.html file.

    Thanks,
    Steve

    Steve · November 02, 2010
  27. Devon,

    First of all this tool rocks my socks!

    But I noticed that the scroll bars don’t appear in firefox, it works flawlessly with all other browsers. Is there something with the java I need to do different? Any help would be great.

    Thanks,

    Felix

    felix · July 26, 2011
  28. Hey Felix,

    Thanks for the comments. I noticed that about Firefox as well. There some been some changes to how it handles embedded Flash recently. There’s a really simple fix, but to be honest, I can’t remember it off the top of my head. A bit of googling should quickly find the solution though. After that, you may want to edit the template file appropriately. One of these days I’ll do so myself and release an update to the tool.

    -d

    Devon O. · July 26, 2011
1 2 Next »

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
  • MainDepth on Unity Ripple or Shock Wave Effect
  • 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
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 © 2021 Devon O. Wolfgang