Archive for 2008
The official launch of Flash Player 10 went live a couple of hours ago.
I’ve just downloaded and and installed the update and am pleased to find that the debug version is working perfectly with Flex Builder 3’s debugger (see past post for issues last time I updated).
So go ahead and download the update!
I’ve been looking into ways to access the Google APIs from Flex recently for an Air Project I’m planning to build in my spare time.
I managed to get the following process working fairly easily in AIR:
Step 1: User enters their Google login details which then get passed to google’s https://www.google.com/accounts/ClientLogin API login script which returns a string of variables including the google session authorization variable.
Step 2: Using the Auth variable passed back from a successful google login you can then call the many Google data APIs available – in the example I built after a successful login the app simply retrieves the user’s google contact list.
This all seemed to be working fine in Adobe AIR.
It was when I tried to port this to a web based RIA that I started running into obstacles.
Most of the problems are down to google’s lack of / restictions in their crossdomain.xml
There’s a crossdomain file here:
http://www.google.com/crossdomain.xml
But it doesn’t include the <allow-access-from domain=”*” /> tag
Plus there’s no crossdomain.xml file on google secure domain https://www.google.com domain which needs to be called to get the authorization variable to access the various APIs.
Even when you run a Flex app locally in a browser you run into further problems if you ever get past the login stage you then need to send the ‘Authorization’ head with “auth=[the_key]” with every API call in the header of you HTTP request.
But guess what? As of flash player 9.0.115 the “Authorization” header was been blacklisted! So it just gets ripped out of the request and the call to google fails!
From reading other posts I understand that you can now use the Authroization header with more recent versions of Flash Player but…
The site you’re calling requires this to be added to the crossdomain file:
<allow-http-request-headers-from domain="*" headers="Authorization"/>
More info from Adobe here:
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403184&sliceId=2
No – that node doesn’t not exist in Google’s crossdomain file! Lol.
So, my next attempt to get round this obstacle involved downloading Abdul Qabiz’s as3httpclient library for adding headers to your http requests from Flex.
This actually gets round the header issue very well and did allow me to call Google Contacts API request url and include the required Authorization header. Locally that is…
As soon as I then tried to run the working files on my remote web server I saw that for socket calls too (this is how the as3httpclient make requests) also requires a crossdomain.xml for socket calls
I give up – am just going to stick to building an AIR app where it all just works…
I can’t claim much involvement in this project apart from a bit of AMFPHP remoting consultancy and optimization but it’s a cool site work taking a look at, Flex side developed by my 2 co-senior Flex Devs – Paddy Keane and Martin McBrearty from my agency – World Archipelago Internet
http://www.nokia.com/headsetdesign
More info on Paddy’s Blog
I haven’t been responsible for the skinning on most of our Flex projects but today that’s exactly what I’ve been doing all day. I just discovered that setting the cornerRadius style of a HBox or VBox has no effect when used on it’s own in css or MXML. The style ‘borderStyle’ also needs to be set to ’solid’ for the cornerRadius you’ve set to display! Weird…
When I first decided to move over to Flex Development version 2 had just launched. I glanced through the feature list initially as I was trying to decide which tool to build for a cool new project that leant itself well to Flex. The project was for a Printing Company who wanted to enable users to design their own business cards, stationary etc and output to a 300 dpi pdf, oh and be able to save their files and re-edit of course! A really nice project.
The application would enable the in-house designers at the print company to create design templates too which the users could use as starting blocks.
One of the reasons I chose Flex for the development on this project was because I thought it was able to load fonts and css at runtime to make re-skinning an application quick and simple. This turned out not to be the case. You had to (and unfortunately still do with Flex 4) go through a middleman process of using one of the built in Flex tools to convert your css file into a style swf that was then compatible with Flex apps and could be loaded in at runtime. I really don’t know why this middle stage is required. Yes, I know that it enables you to embed swf symbols, graphics, sounds and even fonts into the style swf but isn’t the Flash Player capable of loading all these file types in at runtime (not sure about fonts – ie TTF files)? So why can’t the StyleManager class load in the css file directly at runtime, process it working out any required media files and load them in too before dispatching the style changed event? If it had been done this way then I actually think Designers could be introduced to writing Flex css files directly – they’d be able to edit the style css and keep refreshing the Flex application swf without ever having to recompile anything. To me that would be a great improvement on the Flex Design and Development workflow.
I did go to Mark Anders presentation at FOTB where he demoed the new software tool Thermo which is aimed specifically at Flex Skin Designers – certainly a cool edition and it’s nice to see that Adobe have reallised that Flex skinning needs improvement but we still got the middleman – not a style swf anymore, now a new XML style Flex design output with the file extension ‘fxg’. Anyway, I think I’ll blog about that in a separate post…