URL paramaters in Flex

I had a very interesting question last week about accessing URL parameters from within a Flex application. It turns out that it is much easier than I expected! You just need to reference the URL parameter as a variable and away you go. It is maggically is created for you.

You may want to watch out though, if your application references a URL variable and it does not exist, the compiler will throw a warning as it does not know what your variable is, it is most probably a good idea to declare this with the rest of your variables. Secondly, they are only available at the top level of your application, not inside your various other components, so you will need to pass them around, just like any other variable.