Flash crashing Firefox Windows, PC “@” symbol not working…

26th June 2009

Sometimes nasty and seemingly inexplicable bugs just get on your case.

You have a Flash app… its sweet, all working on every browser, every platform… until the client calls up and says “its crashing on Firefox Windows”. You do not believe the client. How can that be? Its Flash. Its supposed to be consistent across all browsers. But no… we have suffered DEEP nightmares with browser-specific issues in Flash recently.

This one is a quick fix.

If you are suffering crashes with your Flash app in Firefox Windows, or you have a textfield that is not responding to the PC input of the “@” symbol… but only to where the symbol would be on a Mac – ie. SHIFT-2, then check to see if your Flash app’s HTML container has the “wmode” parameter explicitly set. If it IS set, remove it. In our case, this fixed the app, and saved our day from a hellish and probably soul-destroying bug-hunt.

We are using SWFObject to embed the app. Here is the culprit:

Not working

var flashVars = { vars: "notShown" };

var flashParams = {
menu: "false",
allowScriptAccess: "sameDomain",
scale: "noscale",
wmode:"opaque" };

swfobject.embedSWF("app.swf", "flashContent", "950", "600", "9.0.0", "/assets/swf/expressInstall.swf",  flashVars, flashParams, {id:"appID"});

Working

var flashVars = { vars: "notShown" };

var flashParams = {
menu: "false",
allowScriptAccess: "sameDomain",
scale: "noscale" };
*** NOTE - wmode param removed ***

swfobject.embedSWF("app.swf", "flashContent", "950", "600", "9.0.0", "/assets/swf/expressInstall.swf",  flashVars, flashParams, {id:"appID"});

Flash CS4 to Flex Builder 3 migration for ActionScript 3.0 (AS3)

18th June 2009

We have been working for five months on a medium-scale app for a large multi-national company. As we approached the beta phase, requests for new functionality started coming, but with 25,000 lines of ActionScript, it was already taking over 45 seconds for the app to compile from the Flash IDE. I made the call to migrate the project over to Flex, and this will be the basis of the discussion as to why every ActionScripter still using Flash as their compiler and IDE should move to Flex Builder.

Over a short series of articles, I hope to shed some light on the reasons. To sum them up:

  1. Every time you save a class, your app compiles in the background – meaning you NEVER need to wait for that “Exporting SWF Movie” dialogue box ever again. This alone is enough once you get into a big app…
  2. SVN support – in layman’s terms, great version control. You work on a class, and when you are happy, you save (”commit”) a new revised version with comments as to what you’ve done. When your app reaches a stable state, you can save it all as a safe working version and press on. You can always compare old versions and retrieve them if need be.
  3. Profiling your apps – if you’ve been used to relying on “trace” statements to debug your apps, you will not believe the precision with which you can dig into the performance of your apps. As well as realtime memory graphs, there are many excellent tools available. For example – loitering objects – take two snapshots of your app’s memory usage over time as it runs, and you can compare the two, seeing not only what objects are still hanging around, but where they came from in the first place – astonishing!
  4. Testing in the browser – you get a much better feel for how things will really work
  5. Creating Flex libraries – for many Flash devs, this is a bit of a nightmare at the beginning, as we’ve been used to setting one preference to give all projects access to whatever classes we like. Its a bit more complex in Flex, but once you’ve compiled your most useful classes, its a breeze to export and use them, and all makes sense

The aforementioned app is built in PureMVC, and is due pretty soon, so I don’t imagine I’ll have a chance to publish anything before then… but I do hope it will help people through the “banging head off wall” phase that I went through on the early days of trying to make the app work in Flex Builder.

London International Music Show

31st May 2009

G-RAFF creative director Steve Jones will be demonstrating Apple’s MainStage application at the London International Music show on Saturday 13th June at 2pm. The show is at London’s Excel Exhibition Centre

Steve has done a few seminars for Apple, being a bit of an evangelist for their Logic Studio software, but showing MainStage is a new departure. He used it live when touring with French band AIR a couple of years ago, claiming it was a “dream come true” for live performance using a laptop.

Bermondsey 167

30th May 2009

bermondsey167

Just launched a minimalist 3D Flash showcase site for a lifestyle store in London – Bermondsey 167.

The idea was to use “tags” behind the scenes so that various “rooms” could be generated easily and quickly without any limitations. Tags can be visible frontside or hidden – for example, everything tagged *init appears on the homepage but that tag is never actually visible to users. This allows a more organic browsing experience that you would have if you went into the shop – one second you are looking at the beautiful shirts of Michael McGrath’s label M2CG, but you turn round and you’re looking at his equally stunning mirror tables and units. Similarly a bright top on the site tagged with “colour” can be clicked to generate a ‘room’ with just colourful items from bookends to photos to a cotton slipover.

Its a quirky shop, with quirky owners and a quirky little dog running around… but that is all part of the character, and it was a lot of fun.

More »

SWFAddress 2.1 (2.2) and SWFObject 2.1 Problems

31st March 2009

Been banging my head off a wall all day wondering why SWFAddress 2.1 wasn’t firing on initialising. The answer is pretty simple – you HAVE to make sure you include “id” in the optional attributes or it just won’t work. Here’s what I had (wasn’t working):

swfobject.embedSWF("darey_v2.swf", "flashContent", "100%", "100%", "9.0.0", "assets/swf/expressInstall.swf", null, params,null);

and it didn’t work… but I changed it to this:

swfobject.embedSWF("darey_v2.swf", "flashContent", "100%", "100%", "9.0.0", "assets/swf/expressInstall.swf", {}, params, {id: "dareysite"});

… and its all sweet – note the extra {id:"id_goes_here"} bit as the last argument to the static embedSWF function.