Making an AIR auto launch swf
I have a client asking me to make an auto launch swf for their AIR app, which I did not develop. I modified their current AIRInstallBadge and it works fine, but now they want a swf on a page that will just auto launch it with no interaction. Basically a swf with no UI, invisible. Is that possible? I've tried the following with no success:
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
var appID:String = validateString(paramObj.appid);
var pubID:String = validateString(paramObj.pubid);
var appLaunchArg:Array = validateString(paramObj.applauncharg) == null ? (null) : ([paramObj.applauncharg]);
var airSWF:Object;
var airSWFLoader:Loader = new Loader();
var AIR_SWF_URL:String = "http://airdownload.adobe.com/air/browserapi/air.swf";
airSWFLoader.load(new URLRequest(AIR_SWF_URL));
airSWFLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleAIRSWFError);
airSWFLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleAIRSWFInit);
function handleAIRSWFInit(event:Event) : void
{
airSWF = airSWFLoader.content;
airSWF.launchApplication(appID, pubID, appLaunchArg);
}
function handleAIRSWFError(event:IOErrorEvent) : void
{
Text.text = "unable to load air.swf";
}
function validateString(param1:String) : String
{
return param1 == null || param1.length < 1 || param1.indexOf("<") >= 0 || param1.indexOf(">") >= 0 ? (null) : (param1);
}
I've tested and all parameters get loaded. I'm sure i'm missing some protocols or it's not possible for for security reasons. Any help would be appreciated.
Thanks,
Adam