Activating Flash Builder 4.7 With a Serial Number

I've just come off the phone with Adobe support after trying in vain to activate a trial version of Flash Builder 4.7 Premium with a serial number.
No matter what, I was always presented with a prompt that asked me to 'renew my subscription', referring to a Creative Cloud subscription which I do not have nor need.
What I do have is a valid serial number. I tried quitting the Creative Cloud app and relaunched FB 4.7: no joy. I chatted and phone Adobe Support: no joy. They told me to email them, and finally someone called me and fixed the issue. Here's how.

Open your Creative Cloud desktop app. On a Mac it has a little cog symbol in the top right corner. Click it.
If there's a sign out option then use that, but in my case there wasn't so I selected Preferences, then on the popup that opened selected 'Account' and then the 'Sign out of Creative Cloud' option.
After signing out I quit the Creative Cloud desktop app.

After that I launched FB 4.7 which now started properly. I wasn't prompted for a serial number at that point so I waited a minute, quit FB 4.7 and relaunched it. Now I saw the serial number prompt, entered my serial number and was all set.

Hope this helps someone.

Accessing the mx_internal Namespace in Flex

This is a topic that comes up from time to time, and it did so for me on a current project so I thought to quickly sum it up again here.
I was working on a Flex project using an old SDK (4.1) and the OSMF-based Spark VideoPlayer component contained within. I had to use this particular player since the customer needed to target Flash Player 10.0 or above.

I'm unsure which version of OSMF this Flex SDK contained, but what I could see was there seemed to be no obvious way to set the bufferTime on the MediaPlayer instance that's contained within the VideoDisplay instance that's contained within the VideoPlayer due to the fact that the MediaPlayer instance was namespaced to mx_internal

view plain
1mx_internal var videoPlayer:MediaPlayer;

What does this namespace mean? It basically is Adobe's way of saying: "Watch out, this stuff right here is likely to change in a future version (of OSMF in this case) and if you mess with it then it may break in the future."

Well in my case it was worth the risk :-) and here's how you'd access the bufferTime property and use the mx_internal namespace.
At the end of all your import statement add this:

view plain
1import mx.core.mx_internal;
2use namespace mx_internal;

Then somewhere else in your code you can do this (where player is my instance of s:VideoPlayer):

view plain
1player.videoDisplay.mx_internal::videoPlayer.bufferTime = 0.1;

Suck this up and enjoy :-)

2012 - Onwards And Upwards

As 2011 is drawing to a close (seriously, where has this year gone?) I think it's time for a quick look forward.

It's been a turbulent year, especially for the Flash Platform. We have some ups, and definitely some downs, and at times it felt as if our beloved community was imploding. Some folks have moved on and are quite likely never to return - 'sinking ship' comes to mind. Whilst I'm not the captain of that particular ship, I certainly hold the rudder for my own little boat and despite what Adobe may want us to believe it is clear to everyone that Flash has had its peak. I feel a bit sad about that, and it's not really because of the technology but because of the aforementioned community; I just don't feel that I'll find the same mix of creativity, problem solving and 'thinking outside the box' spirit elsewhere. The Flash community has been and still is one of a kind and I hope it will stay that way in 2012 and beyond.

In terms of new technologies to pick up next year there are plenty to choose from. Too many almost, and I for one feel a bit overwhelmed at times. I have a feeling I am not alone.

› Read Full Article

Shorthand For Sorting ArrayCollections In ActionScript & Flex

Here is a tip containing a quicker way to sort an ArrayCollection in ActionScript by using the underlying Array sortOn method. By quick I mean less code - I make no statement about performance.

Normally to sort an ArrayCollection you would need to create instances of both the Sort and SortField classes to arrive at something like this (untested code to give you an idea):

view plain
1var sort:Sort = new Sort();
2var sortField:SortField = new SortField(); = "myFieldName";
4sortField.numeric = true;
5sortField.descending = true;
7myCollection.sort = sort;

However since the source property of the ArrayCollection class points to the Array that acts as the source of the Arraycollection's data you can mess with it if you like (it's a bit naughty as you are not meant to do this and your mileage may vary).

So therefore to sort the above example 'myCollection' numerically by 'myFieldName' you could to this:

view plain
1myCollection.source.sortOn('myFieldName', Array.DESCENDING | Array.NUMERIC );

I'm sure someone will tell me off for this but here you go. This worked for me for my purposes and it seems a lot simpler. And I like simple things.

Setting up Chrome for Debugging on OSX in Flash Builder/Eclipse

Here's a quick tip if you'd like to add Chrome as your default browser (or secondary for that matter) in Flash Builder.

You may have noticed that Eclipse seems to struggle with this if you browse for the location and end up with '/Applications/Google' as the path: it gets rejected as soon as you click 'ok' stating that 'The location value is not a valid path name'.

After a bit of trial and error I managed to find a valid path name after checking out the existing browsers' paths in more detail. Here's what seems to work for me:

view plain
1/Applications/Google Chrome

Note that under Windows you may not encounter this issue. Hope this helps someone.

The End for Adobe's Multi-Screen Strategy?

The End for Adobe's Multi-Screen Strategy? - This is a question that Tim Siglin asks in his recent article on the sudden death of the HP TouchPad and WebOS.

My initial reaction to reading that header was one of suspected link-baiting; but since I know Tim well enough I knew that his style of writing goes substantially deeper than that of an attention-grabbing headline (but hey, this didn't stop me from re-using it. You see my standards are far far lower and since you are now reading my post it clearly has paid off ;-).

So does Tim have a point? Does the demise of WebOS and the sluggish uptake of other (non-iOS) mobile operating systems outside of Android really spell bad news for Adobe and its multi-screen dream?

› Read Full Article

Some Tips For ColdFusion Remoting Over SSL in Flex

I apologise in advance for this slightly unstructured post but this topic has been in the back of my mind for a while, so before I completely forget the details I btter write it down.

I've recently had to port one of my Flex applications, a simple CRUD admin console hitting a MySQL database via CF9, to use a Remoting connection over SSL. I recalled hat in the past this setup had given me some headaches: 'normal' CF Remoting from Flex over HTTP was pretty simple to get going, but switching to HTTPS had not been as simple. Therefore here is a quick checklist (and note: it may be incomplete) if you have the same task at hand.

› Read Full Article

Localising Flex Applications

A word of warning upfront: The following post is a rough summary of a week's trial and error. Some of the points made may be correct, but there may also be better ways of doing things than what's described here. Use at your own risk.
Some links that I found helpful but which admittedly also confused me greatly at times include The flash.globalization package in Flash Player as well as what I consider one of the best intros to the subject, an article by Charles Bihis on Devnet. Charles' article should be your first stop as it covers important setup steps such as compiler options and steps needed to compile framework resources (a challenge in itself and one I will get back to later in this post).

Generally speaking, Flex makes it easy to localise applications for multiple languages. Classes such as the ResourceManager are very helpful, and implementing localised labels, strings and so on is pretty simple. What I found not so simple is to determine the correct initial locale that should be set. And in typical flex fashion that was only the tip of the iceberg...

› Read Full Article

Migrating StyleManager.getStyleDeclaration (Flex 3) to IStyleManager2.getStyleDeclaration (Flex 4)

Today I was working on a Flex 3 application which I now want to compile using the Flex 4 SDK. One of the warnings that cropped up in the Flash Builder Problems panel was the following message:
3608: 'getStyleDeclaration' has been deprecated since 4.0. Please use 'IStyleManager2.getStyleDeclaration on a style manager instance'.

The line in question was the following which applies a global theme color after a color value has been loaded from a remote data source::

view plain
1StyleManager.getStyleDeclaration('global').setStyle('themeColor', '0x'+gradient_to);

It took me some time to figure out what the heck the 'use IStyleManager2.getStyleDeclaration on a style manager instance' actually meant... it was by no means a straight forward warning. After some Googling and trial and error I came up with this which seems to do the job:

view plain
1var cssDeclaration:CSSStyleDeclaration = FlexGlobals.topLevelApplication.styleManager.getStyleDeclaration('global');
2cssDeclaration.setStyle('themeColor', '0x'+gradient_to);

I'm not sure if this is the correct and/or best way to achieve the same thing but it appears to work which generally is good enough for my requirements :-)
Hope this helps someone, please leave feedback and corrections where applicable.

Securing Remoting Access To ColdFusion CFCs From Flex

Today I was working on a Flex application which uses a lot of Remoting calls to a bunch of ColdFusion CFC methods. I wondered what the most efficient way of securing these methods would be since they are effectively wide open to the world as they all (have to) specify access="remote". This means that anyone with a web browser can invoke the methods and they will even return nice error messages when certain parameters are missing.
One way of restricting access would be to run all Remoting calls through an intermediate page or CFC which handles authentication and access control and which in turn invokes the (now private) CFC methods. I found this a bit cumbersome and I also knew that there was a better way - I remembered the setCredentials method back from the AS2 days. You can see this described in greater detail by Brandon Purcell in his MAX session Securing Applications from 2003(!), but unfortunately it is not directly usable in today's Flex world.

While Brandon's example is great, and Ray Camden also has some details to add, neither example had all the pieces I needed, particularly an example of not just authenticating a Flex application properly with a CFC but also how to log out again (and to jump ahead, simply running a cflogout tag did not work...).

› Read Full Article

More Entries