Category Archives: Useful

Fix for cross-domain ExternalInterface 'Unspecified error'

Making a note of this here because I don’t see it in any of the docs.

When using ExternalInterface cross-domain (i.e. the swf and JS are on different domains) you may get an ‘Unspecified error’ message in IE. Debugging in Visual Studio gives an ‘unknown exception’ in the return statement of this function:

function __flash__addCallback(instance, name) {
instance[name] = function () {
return eval(instance.CallFunction("" + __flash__argumentsToXML(arguments,0) + ""));
}
}

The fix is to add

System.security.allowDomain("*");

in your AS code. ExternalInterface requires the allowDomain to be set when HTML-SWF cross-scripting is performed even though it’s local to your browser. Thanks to my co-worker Sean Neville for this information.

(Note that you will also need to set allowScriptAccess="always" in the swf embed tags to allow cross-scripting)

SimpleViewer v1.8 Released

I finally got around to updating SimpleViewer. SimpleViewer is a free, customizable image viewing app that’s been suprisingly popular – I currently get around 7,000 downloads a week. It can be time-consuming to provide support, but it’s also gratifying to know lots of people are enjoying my software.

You can view the list of new features and bug-fixes here. Most of these feature were based on user feedback from the forum. The previous SV code was a few years old now and was starting to show it’s age, so I re-coded it from scratch in AS2.

I also offer SimpleViewer-Pro for sale here. The new version of SimpleViewer-Pro is a lot easier to customize than the previous version.

I’d also like to say a big thanks to the people who have provided additional methods to generate SimpleViewer galleries, such as Porta, SimpleViewer iPhoto Export, SimpleViewerAdmin and FlickrViewer. Thanks!

Export to PostcardViewer from Photoshop

Another update to PostcardViewer. Jeffrey Tranberry from Adobe has provided this excellent script to create a PostcardViewer gallery directly from Photoshop. Instructions are here. Nice one Jeff!

PostcardViewer Update

PostcardViewer has been updated. PostcardViewer is a free, customizable Flash image viewer. The interface is based on the real world metaphor of a set of postcards shuffled onto a surface.

I’ve also posted a Picasa web template to make creating your PostcardViewer galleries really easy. Just select your images in Picasa and click “Export as Web Page…”. Thanks to Albert W Alberts for the template.

One other update worth mentioning: the SimpleViewer Picasa web template has also been updated.

Simple Image Search

It feels very good to finally get this one off my chest! I’ve been meaning to build a nice Flash interface for image search for a long time now. I tried it in Flash 7, but it turns out that most of the images on the web are progressive-JPGs. Since Flash 8 can handle progressive JPGs, if figured I had to git ‘er done. Check out the app here.

The search results are courtesy of Yahoo’s fantastic Image Search API. Originally I had tried to connect to Google’s image search by using screen-scraping, but it turned out to be much easier to hook up to the Yahoo API, which returns nicely formatted XML.

The interface is designed to be a simple as possible, while retaining some powerful features. Hopefully this is something that is genuinely useful and will “empower image searchers across the world” (cue dramatic music). Check out a more in-depth description of Simple Image Search here. Please let me know if you have comments, suggestions or bugs.

Web debug proxy roundup

If you are developing Flash sites that talk to a backend system via XML or flash remoting, you need a web debug proxy.

A web debug proxy sits between your machine and the internet, and displays any HTTP traffic that passes between the two. This is invaluable for debugging Flash RIAs and data driven sites, by showing you exactly what data is being loaded into the browser. Some web proxies also offer bandwidth throttling which simulates a slow internet connection, and is useful for testing flash preloaders. There are currently 3 web debug proxies that are commonly used:

  • Fiddler. Windows only (requires .NET Framework v1.1). IE only. Free. Does not offer bandwidth throttling. Allows you to manipulate the data being loaded on the fly.
  • Charles. PC/Mac/Linux (requires Java 1.2). Firefox/IE compatible. 30 day trial, $50 for a license. Offers bandwidth throttling. Full featured but can be a little slow to load.
  • ServiceCapture. Windows only (requires Java 1.4.2). Firefox/IE compatible. 15 day trial, $35 for a license. Offers bandwidth throttling. Works well with flash remoting data, fast loading, clean interface. (Disclaimer: ServiceCapture is developed by my workmate Kevin Langdon.)