Archive for April, 2007

Query String Inspector for Flex

Thursday, April 5th, 2007

It is common for Flex applications which are deployed to an application server to require specific parameters be provided via the applications query string.

The Flex Framework Application class provides a parameters property which contains the query string provided to the application as well as the FlashVars HTML parameters provided to the application. This is very useful as developers are no longer required to facilitate interoperability between ActionScript and other languages, typically JavaScript, just to get an swf applications query String.

The QueryString inspector is an all static class which takes advantage of this by providing an API which allows developers to perform detailed inspection of an applications Query String.

Below is a description of each method:

  • rawQueryString: Retrieves the raw query string provided to the application
  • isProvided: Determines if parameters have been provided to the application
  • nameValuePairs: Creates an Array of objects comprised of each name / value pair provided to the application
  • parameters: Retrieves the parameter names provided to the application
  • values: Retrieves the parameter values provided to the application
  • containsParameter: Determines if the specified parameter has been provided
  • containsValue: Determines if the specified value has been provided
  • getValue: Returns the value of the specified parameter
  • length: Returns the length of the query string

FileWriter API for Apollo

Tuesday, April 3rd, 2007

I have published a simple FileWriter API for Adobe Apollo which is essentially an all static class providing methods for synchronous and asynchronous File creation.

FileWriter encapsulates file creation in an all static class which can be used to easily and intuitively create files to a local file system simply by specifying the name of the file to create as well as the path in which to the file is to be created.

FileWriter will create a new file if the file does not currently exist and return an open FileStream referencing the file object via FileMode.WRITE, otherwise FileWriter will open a previously created file and return an open FileStream referencing the File via FileMode.UPDATE.

You can view the source as well as download the basic sample application which allows you to create a File to your desktop utilizing the FileWriter API.