Skip to content
zarate edited this page Mar 30, 2011 · 3 revisions

You can set up some configuration variables at runtime by using "FlashVars". The quoutes come because in the stric sense of the word, they are not FlashVars when the app runs as an AIR app.

There are 2 values you can set up at runtime:

  • Path to the tests XML.
  • Path to the results gateway.

See How it works for more information on how these 2 variables affect the application.

AIR and Android

First, if you plan to use FlashVars in AIR / Android, just download the sample flashvars.conf file.

Android applications can be installed on the phone or in the SD card. The first place the application tries to locate the FlashVars file is (roughly) in:

File.applicationStorageDirectory + "/flashvars.conf";

In Android File.applicationStorageDirectory will return a path in the /data/data folder regardless of your app being installed on the phone or in the SD card. This is problematic since the /data/data directory is protected and you might not be able to access it unless you root your phone.

When other Android apps are installed on the SD card their data folder changes to /sdcard/data/data where regular users can read and write without problems. TestF will check for both locations.

Full list of locations

TestF is using AIR's applicationStorageDirectory so knowing that TestF's application ID is net.testf.benchmark and the directory depending on your system you can build the location based on your system:

  • Windows:
    • XP: c:\Documents and Settings\USERNAME\Application Data\net.testf.benchmark\Local Store
    • c:\users\USERNAME\appdata\roaming\net.testf.benchmark\Local Store
  • OSX: ~/Library/Preferences/net.testf.benchmark/Local Store
  • Linux: ~/.appdata/net.testf.benchmark/Local Store
  • Android:
    • /data/data/air.net.testf.benchmark/net.testf.benchmark/Local Store
    • /sdcard/data/data/air.net.testf.benchmark/net.testf.benchmark/Local Store

Running as a SWF

If you run the test as a SWF, you can too modify the FlashVars by using good old FlashVars when instantiating the app in your HTML code. This is a snippet using SWFObject:

<script type="text/javascript">
	var flashvars = {fv_testsXml: "path/to/your/tests.xml", fv_resultsGateway: "http://yourserver.com/gateway"};
	var params = {};
	var attributes = {};
	attributes.id = "testf";
	swfobject.embedSWF("testf.swf", "myAlternativeContent", "100%", "100%", "10.1.0", false, flashvars, params, attributes);
</script>
Clone this wiki locally