launchApplication throwing #2044 error
i have swf on webpage loads air.swf api's can launch installed air application using launchapplication() method. air application launches when tail flashlog.txt file, see "error #2044" iterated couple of hundred times (no trace() statements app output). when launch air application manually (double-click) trace() statements in app output correctly.
i have <allowbrowserinvocation></allowbrowserinvocation> set 'true'. have listeners in air app set handling browserinvokeevent. air app code , swf launcher code below.
what's #2044 error? air 1.5 not handle browser invocation correctly?
air application:
swf launcher:
i have <allowbrowserinvocation></allowbrowserinvocation> set 'true'. have listeners in air app set handling browserinvokeevent. air app code , swf launcher code below.
what's #2044 error? air 1.5 not handle browser invocation correctly?
air application:
quote:
<?xml version="1.0" encoding="utf-8"?>
<mx:windowedapplication xmlns:mx=" http://www.adobe.com/2006/mxml"
xmlns:comp="components.*"
layout="absolute" width="990" height="710"
verticalscrollpolicy="off" horizontalscrollpolicy="off"
showflexchrome="false" showstatusbar="false" showgripper="true" showtitlebar="false"
initialize="oninitialize()"
creationcomplete="oncreationcomplete()">
<mx:script>
<![cdata[
import flash.events.browserinvokeevent;
private function onbrowserinvoke(e:browserinvokeevent):void {
trace("debug: onbrowserinvoke()");
trace("\t|__ "+e.arguments);
}
private function oninitialize():void
{
trace("debug: oninitialize()");
trace("debug: publisherid:"+nativeapplication.publisherid);
trace("debug: applicationid:"+nativeapplication.applicationid);
nativeapplication.nativeapplication.addeventlistener(browserinvokeevent.browser_invoke, onbrowserinvoke);
}
private function oncreationcomplete():void
{
trace("debug: oncreationcomplete()");
nativewindow.x = (capabilities.screenresolutionx - nativewindow.width) / 2;
nativewindow.y = (capabilities.screenresolutiony - nativewindow.height) / 2;
}
]]>
</mx:script>
<comp:applicationmain showbreakawaybutton="true" width="100%" height="100%" />
</mx:windowedapplication>
swf launcher:
quote:
package {
import flash.display.*;
import flash.events.*;
import flash.geom.colortransform;
import flash.net.urlrequest;
import flash.system.*;
import flash.text.textfield;
// airbadge our main document class
public class launchapplication extends movieclip {
private const browserapi_url_base: string = " http://airdownload.adobe.com/air/browserapi";
private var _applicationid:string;
private var _publisherid:string;
private var _arguments: array;
private var _loader:loader;
private var _air:object;
public function launchapplication() {
_loader = new loader();
var loadercontext:loadercontext = new loadercontext();
loadercontext.applicationdomain = applicationdomain.currentdomain;
_loader.contentloaderinfo.addeventlistener(event.init, oninit);
_loader.load(new urlrequest(browserapi_url_base + "/air.swf"), loadercontext);
var parameters:object = loaderinfo(this.root.loaderinfo).parameters;
_applicationid = "com.application.telnetprototype";
_publisherid = "55c8a271bcbc06dbe0d19c7886420261d1d77123.1";
_arguments = string(parameters["arguments"]).split(",");
}
private function oninit(e:event):void {
_air = e.target.content;
switch (_air.getstatus()) {
case "installed" :
statusmessage.text = "air installed , has been detected."
launchbutton.buttonmode = true;
launchbutton.usehandcursor = true;
launchbutton.addeventlistener(mouseevent.click,onbuttonclicked);
break;
case "available" :
// air available
statusmessage.text = "air not installed - application cannot launched."
break;
case "unavailable" :
// air not available
statusmessage.text = "air not installed - application cannot launched."
break;
}
}
private function onbuttonclicked(e:event):void {
statusmessage.text = "attempting launch air application";
_air.launchapplication(_applicationid, _publisherid, _arguments);
}
}
}
More discussions in Archived Spaces
adobe
Comments
Post a Comment