How do I pass configuration parameters to Flash?

To send configuration parameters to Flash, you will just need to pass the values in the SWF URL as a query string. For example:

myflash.swf?id=25&page=69&type=454

You access those values from flash like this:

var id = root.loaderInfo.parameters.id; 
var page = root.loaderInfo.parameters.page; 
var type = root.loaderInfo.parameters.type; 

Whenever you reference the SWF, such as when sharing it via an API call, putting it as the value of a tag on your HTML page, just be sure to include the appropriate parameters there.

Still need help?


General Topics

 

Developers