How to launch an adobe air application from browser

前端 未结 3 938
孤城傲影
孤城傲影 2021-01-06 07:26

Is there a way to launch an Adobe Air Application from the browser? I am developing an application that uses webcam, and when the user enter on my site, I need to start this

3条回答
  •  旧巷少年郎
    2021-01-06 08:08

    1.Set allowBrowserInvocation as true in app.xml

    2.Register BrowserInvokeEvent in completion,

    NativeApplication.nativeApplication.addEventListener(BrowserInvokeEvent.BROWSER_INVOKE, onBrowserInvoke);

    3.Then define,

    protected function onBrowserInvoke(event:BrowserInvokeEvent):void 
    {
        argumentsText = event.arguments.toString();
    }
    

    4.Create Web Application with creation Complete,

    var airSWFLoader:Loader = new Loader();
    var loaderContext:LoaderContext = new LoaderContext();
    loaderContext.applicationDomain = ApplicationDomain.currentDomain; 
    

    5.Add this in click action on your control which launches client AIR app,

    var appId:String = ""; //Your client app id 
    var pubId:String = ""; //client air publisher
    var arguments = //define
    airSWF.launchApplication(appId, pubId, arguments);
    

提交回复
热议问题