Archive for the ‘geek’ Category

Flash Querystrings in AC_RunActiveContent.js

Wednesday, February 10th, 2010

For the benefit of anyone as baffled as I was half an hour ago: if you try to pass a variable to a SWF via the Querystring (or FlashVars) and it just doesn't work, try this. For some inexplicable reason it seems to be not covered fully in the Flash documentation.

When you publish in Flash CS3, the HTML that is created looks like this (in this case the FLA is called 'passtest'):

<script language="javascript">

if (AC_FL_RunContent == 0) {

alert("This page requires AC_RunActiveContent.js.");

} else {

AC_FL_RunContent(

'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',

'width', '550',

'height', '400',

'src', 'passtest',

'quality', 'high',

'pluginspage', 'http://www.macromedia.com/go/getflashplayer',

'align', 'middle',

'play', 'true',

'loop', 'true',

'scale', 'showall',

'wmode', 'window',

'devicefont', 'false',

'id', 'passtest',

'bgcolor', '#ffffff',

'name', 'passtest',

'menu', 'true',

'allowFullScreen', 'false',

'allowScriptAccess','sameDomain',

'movie', 'passtest',

'salign', "

); //end AC code

}

</script>

<noscript>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="passtest" align="middle">

<param name="allowScriptAccess" value="sameDomain" />

<param name="allowFullScreen" value="false" />

<param name="movie" value="passtest.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="passtest.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="passtest" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object>

</noscript>

Assuming you want to pass the variable kittens=wonderful, because they are, this needs to be changed to (note changes in bold text):

<script language="javascript">

if (AC_FL_RunContent == 0) {

alert("This page requires AC_RunActiveContent.js.");

} else {

AC_FL_RunContent(

'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',

'width', '550',

'height', '400',

'src', 'passtest',

'quality', 'high',

'pluginspage', 'http://www.macromedia.com/go/getflashplayer',

'align', 'middle',

'play', 'true',

'loop', 'true',

'scale', 'showall',

'wmode', 'window',

'devicefont', 'false',

'id', 'passtest',

'bgcolor', '#ffffff',

'name', 'passtest',

'menu', 'true',

'allowFullScreen', 'false',

'allowScriptAccess','sameDomain',

'movie', 'passtest?kittens=wonderful',

'salign', "

); //end AC code

}

</script>

<noscript>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="passtest" align="middle">

<param name="allowScriptAccess" value="sameDomain" />

<param name="allowFullScreen" value="false" />

<param name="movie" value="passtest.swf?kittens=wonderful" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="passtest.swf?kittens=wonderful" quality="high" bgcolor="#ffffff" width="550" height="400" name="passtest" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object>

</noscript>

The key bit not mentioned in the documentation is the first change in the first script block. The querystring needs to be appended to the movie (not SRC) parameter, and without the .swf in the filename.

Once this is done the variable kittens will now be available as _root.kittens. You can append several variables as you would in HTML (?thisvar=that&theother=somethingelse), and all must be URL encoded.

And that's it. Normal cats photos / train company problem posts will resume immediately.

Windows 7 on the Acer Aspire One

Wednesday, September 16th, 2009

Having finally managed to buy a netbook computer (an Acer Aspire One A150 that cost me just £150) there was one thing I installed before anything else: a copy of Linux. The reasons for this were simple: I wanted a computer that started up fast and that wouldn't be held back by security software hogging the (limited) CPU.

And yet I've since blanked the Linux partition and installed the RTM copy of Windows 7. So what went wrong?

Linux Limitations

I should point out that Linux wasn't disastrous. I installed the Ubuntu Netbook Remix Linux distribution which, after a few command line tweaks, worked fairly well: the keyboard, display and USB ports were fine, and the wireless adapter connected. Over time, though, a few niggling problems began to bug me.

Firstly, the SD card slots didn't work properly. No big problem, but annoying when you have to reboot to get photos from a card. More importantly, two key power saving options weren't working: I couldn't easily enable and disable the wireless, for example (no visual feedback when you toggle the switch), and attempts to turn the display brightness down were torturous, requiring me to hit the key combination dozens of times. No fun when you're at a press conference and attempting to save what's left of the battery. Flash video playback was also terribly stuttery.

Installing Windows 7

And so to Windows 7. Having seen the W7 beta running on a Samsung NC10 I thought I'd give it a try, and so far it's worked very well. Installation from the RTM DVD was as simple as could be: no extra drivers were needed, and from the first start I had the wifi, sound and display controls working perfectly.

Windows 7 boots up in roughly the same time as Ubuntu – it's certainly not so slow as to be annoying – and once loaded with all the same software (Firefox, VLC, Gimp etc) works very nicely. And using my extremely unscientific "how do anime videos encoded in Flash stream from Crunchroll.com" benchmark, Firefox on Windows rates as "plays them in 480p" versus Firefox for Linux's "the lowest quality version just about plays".

There are, of course, a few drawbacks to using Windows. For one, Ubuntu cost nothing – Windows 7 will set you back £150 (although I've seen the Home Premium edition for under £70, even after the price rise). And of course I now need security software – an OEM copy of Kaspersky set me back a tenner.

Lessons Learned

I haven't given up on Linux for netbooks – ultimately I think a smaller, lighter OS with a stramlined interface such as UNR makes sense on this kind of PC, but on this hardware, and for the moment, it's just not quite good enough. I'll try the next versions of Xubuntu and Ubuntu UNR when they're released, but if one does get installed I think it'll be dual-booting alongside Windows.

Random broadband facts:

Saturday, August 15th, 2009

I'm researching an article on the history of broadband. A few interesting things I've come across:

  • In 2000 a 512Mbps Blueyonder connection cost £50/month
  • In 2001 broadband accounted for less than 1% of UK internet connections. 81% were dial-up (ONS)
  • By 2005 half of UK connections were broadband (ONS)
  • In 2009 56% of UK households have broadband access (ONS), and the average UK connection speed is 3746Kbps (Akamai)
  • Virgin is currently testing <200Mbps FTTC, with BT working on VDSL.

Not bad going. But on the other hand: the average connection speed in South Korea, Q1 2009 is 10956Kbps, with SK and Japan both offering >100Mbps consumer products today (SK uses VDSL, Japan has a strange FTTC-like infrastructure). That's fast.

IMAXish

Monday, May 18th, 2009

Greenwich ImaxSomewhere in deepest darkest Greenwich, out near the Millenium Dome, lies an Odeon multiplex cinema. Formerly a Filmworks, it's the shape of a huge bucket and holds 18 screens including, since December, an IMAX theatre.

How, I wondered, can you cram an IMAX screen into an existing cinema without ripping a good half-dozen other screens out? The answer is that, as it turns out, you don't. You stick a smaller screen in, slap a big IMAX badge on the outside and a few extra quid on each ticket.

Look on the web for information on the Greenwich IMAX and you'll find that IMAX has been outfitting cinemas with a system completely different to its traditional "build a screen the size of Jupiter and project 70mm film on it" setup for some time. Some people are very angry with the fact that the new, identically named, IMAX system is obviously inferior to the original as it uses a far smaller screen and relatively low-spec projectors (two 2K, rather than 4K, models). You'll also find an Odeon website blathering about "floor to ceiling screens" and "theatre geometry", while a local newspaper report shows four kids with an oversized ticket and the rather grainy picture of the screen I've reproduced above.

Nothing on the web, though, could tell me what I needed to know: should we pick an IMAX showing of the film (conforming entirely to stereotype, we wanted to see Star Trek) at Greenwich or the slightly cheaper 35mm screening next door? So, dear Google indexing robots and those who may be searching for the same information, here's my two cents.

The IMAX screen (9) is, appropriately, one of the biggest – almost 240 seats in three banks. Most of the central bank are "premier" seats that cost extra. We were on the aisle on a side bank about two thirds of the way up, and the view was fine – the rake's quite steep, so you can see clearly over those in front. The screen itself is nowhere near IMAX size, but large enough for the auditorium and, yes, almost floor to ceiling, while the sound system is impressive if terrifyingly loud. The image in our showing was brilliant for roughly two hours of the film, but marred by annoying blue stripes for about two minutes near the start – whatever caused these, they were fortunately banished.

So, is this new, smaller IMAX a con? Possibly – it's certainly confusing. Is it worth a fiver per ticket if you know it's not proper IMAX, though? I'd say so: short glitch aside, the picture is better than most that I've seen in UK multiplexes lately, so you're paying a bit more for a high quality digital screening. And, as an added bonus, there's very little pre-film advertising to suffer through – just a few IMAX idents and two of the dumbest trailers I've ever seen (Transformers 2 and, honestly, GI Joe The Movie). Go, gawk, enjoy – just don't cough up any more for the Premier seats.

Oh, and Star Trek is really rather good. Thanks for asking.

BBC Click / ITN

Saturday, April 11th, 2009

The Easter-themed segment I filmed for the BBC last week went out this morning and repeats over this weekend. It's not yet on iPlayer, so here's a low resolution clip:

(Video)

And while on the subject of shameless self-promotion, here's the thing I did for ITN the other week:

Public service announcement

Thursday, March 12th, 2009

This is geeky. Feel free to turn away now.

Ahem. Anyhow, if you're Googling to find out if you can play Blu-ray movies using a Celeron E1200 processor, as I was just the other day, then the answer is: just about. Google couldn't tell me the answer then so I'm adding to the sum of human knowledge, or something.

Details: Cerelon E1200 (stock, £30 ish), Gigabyte GA-73PVM-S2H (£40, includes GeForce 7100 graphics), Sony BDU-X10S (£50). Discs play, and everything looks fine, but some panning shots begin to overtax the CPU (already at 98%, both cores) and look juddery.

Stick in an E5200 instead (£60) and it runs fine – CPU at 50-60% playing Blu-ray, rising during the tricky bits. I imagine that putting in a HD-decoding video card might help the E1200 along, but that's not an option in my case.

We've come a long way

Tuesday, October 21st, 2008

I've reviewed probably a couple of hundred MP3 players over the years, but this post on choosing a player for the first time reminded me of the first one I actually used. This was a SmartDisk Rover, back in 2002 or so. It held 128MB of music – two to three albums, give or take – and had no display. It also had nothing that could, even charitably, be called a design.

Since then I've owned a few. One Creative MuVo NX, one Archos Gmini XS, one Creative Zen Xtra (my beloved 30GB iBrick), one original iPod Shuffle and a couple of dodgy no-name personal video players later, I'm now using an 80GB iPod Classic. This has over 600 times more storage than the Rover (enough to swallow every record I've ever purchased) plus a huge and swanky colour screen and a battery that'll outlast a transatlantic flight even when using it to watch TV shows. Also, as an added bonus, it's nowhere near as ugly.

And all those changes in six years. It's quite amazing, really.

5, 4, 3, 2, 1, JUMP!

Saturday, September 27th, 2008


Hunter takes off – in HD from Tom Royal on Vimeo.

Hunter does his bit for science, helping me test the EX-F1's 60fps mode. This was shot as 60 6mp JPEGs in a one second burst and then smooshed onto the interweb, hence the dubious image quality (technical smooshing details: JPEG images resized to 960×1,280px in Photoshop, stitched into an AVI with JPEGVideo, converted to H.264 in Quicktime Pro then uploaded).

(NB – he did actually land safely about a second later. And he caught the snake, too.)

Spin spin spin

Thursday, September 25th, 2008

As per Si's note, the video below is very flickery so anyone with epilepsy, or who simply dislikes flickery things, should probably beware.

A test taken with the Casio EX-F1, which shoots video at 300fps or full-resolution photos at 60fps. The plan now is to film Hunter or Ralph jumping – it needs lots of light at this speed, though.

Delicious (del.icio.us) accelerator for IE8 Beta 2

Sunday, August 31st, 2008

The other day I met some people from Microsoft, who were in London to show off Internet Explorer 8 Beta 2. One of the most interesting features – to me, at least – was the new Accelerators menu: if you highlight a block of text in the browser a context menu appears, allowing you to use that information (you could highlight a postcode and send it to Google Maps, for instance).

Personally, I'd like to use this to send items to Delicious, but there doesn't seem to be an official Accelerator for that yet. In the interim, here's one I've made:

It works in three ways. If you invoke it from a page, that page is sent to be bookmarked. If you invoke it on a link, the target page is sent with the link text as its title. And, more usefully, if you invoke it on some selected text the current page is sent, with the title automatically set and the selected text pre-entered into the notes field. All three methods open Delicious in a new tab, ready for you to add any tags you want.

Three caveats to note:

  • I've tested this accelerator in IE8 Beta 2 under XP and Vista, but any use is at your own risk.
  • I am not affiliated with Delicious in any way, and this is not an official Delicious tool.
  • Log into Delicious before using the Accelerator. If you are not logged in some info (notes, title) may not be transferred correctly on first use of the Accelerator.

Quick screenshot of the installed Accelerator: