About Me

My photo
Derek lives in Wall Street, Lee-Over-Sands, St Osyth. A mobile and event software/product designer by trade - and is keen to improve things for all the local residents - and has lived in this idyllic location since 2009.

Saturday, 10 October 2009

Adaptive Resolutions

Its amazing how much work you have to put into the simplest things sometimes with Flash. Recently I was working on a Plasma/Projector screen app, and the client announced that his projector was 4:3 ratio. Being a forward thinking (or so I thought) chap, I had originally designed the app to run in "Full HD" e.g. 1920 x 1080.

Now Flash fullscreen .exe files are lovely beasties, and suffer few connectivity and sandbox security issues than a browser based flash app (mainly because it is implied that the use ran the .exe so wants full network access). This also means, as long as you make all your elements as vector graphics as I do, it scales beautifully and automatically, whatever the resolution.

I found a really odd situation - after thinking through the best approach I decided that the app should detect the height of the Flash Player .exe window, then use code to top align the stage, and use deeper page elements. Sounds simple doesn't it. Well as usual with software development, it wasn't - and that is where the problems began. After a few experiments and head scratching, I found some code that I'd used on our touchscreen building software I built a while back, that listens for a change in window size, although that used Javascript from the browser to transmit the size into the flash movie, which then reacted with the incoming data. Being an exe file, with no browser, obviously that technique wouldn't work in the same way. However - It seems that the only way you can do this is turn off Flash's automatic scaling feature.

Now this would be fine, except that the "design size" was HD, so when this param goes on, zap, most of your design is offscreen on a low resolution monitor... Grr... I don't want my content going off screen thankyou very much!

What a nightmare. In the end, I opted for the quickest solution, remove the auto-sensing feature and stick a parameter in a locally loaded text file saying screenAspectRatio="4x3". Then the staff setting up the kit onsite can look at the screen and decide on the format, changing the text file params to "16x9".


I'm pretty sure there is a chance it can be done automatically though, I mused over switching the parameter off, measuring it and switching it back on, but that seems daft, The main issue is that it seems there just isn't a usuable parameter you can interrogate to return the window size unless you turn off automatic scaling.

I have a few forum responses to check - as its always best to see if anyone else is trying to do what I'm doing, however most Flash developers always work on the web, it seems few build standalone applications.

Of course the mantra here, that I've learned over the years in the commercial world, with short deadlines - sometimes you have to compromise, if only for the short-term to get a job done.

No comments:

Post a Comment