Testing Flash Projects w/ Dynamic Variables

Many of the Flash modules and widgets I write are part of a larger system. Normally, some sort of ID or other variable piece of data will need to be passed in as flashvars upon initialization to allow the SWF to function correctly, making the appropriate data calls and so forth. When testing in the IDE, however, you are separated from the larger application and that data does not exist.

A simple way to test such items in the standalone Flash Player is to check whether those variables are being passed in… if not- simply use your test variables.

if (root.loaderInfo.parameters.appPath != undefined) {
	appPath = root.loaderInfo.parameters.appPath;
} else {
	appPath = "http://yourwebsite.com/somepath/";
}

This, for example, might be included within the document class constructor function. Easy and flexible!

1 thought on “Testing Flash Projects w/ Dynamic Variables”

  1. Pingback: In Flagrante Delicto! » Simple AS3 Slideshow Widget: Part 2

Leave a Comment

Your email address will not be published. Required fields are marked *