Skip to: Site menu | Main content

Welcome to JasonHolden.com

Here you'll find information about my work and services.

Blog...

URL variables in Flex.

I want to access the URL variables in the URL of the page that launches my Flex application.

The problem:

There is no built-in way to access the querystring or url variables from inside Flex. Any parameters must be passed in as flashvars.

I scoured the web and found this:

How to get URL query-string variables within Flex application

Pretty neat code. Abdul is basically calling the browsers built-in javascript methods for retrieving the URL and querystring values. It doesn't require any additional/custom javascript.

I didn't integrate the class with my code. My needs were simple and could be handled differently within the confines of Flex/Flash.

What this has really done is open my eyes to the ExternalInterface API. The API provides facilities for interacting with the Javascript on the calling page.

If you need easy access to your URL params or just want to see a demo of the ExternalInterface API you should check out Abdul's code.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.7.002.