How to launch an adobe air application from browser

前端 未结 3 915
孤城傲影
孤城傲影 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);
    
    0 讨论(0)
  • This thread on the Adobe forums links to the overview of launching Air apps from the browser, and the discussion covers some common problems you might encounter.

    0 讨论(0)
  • 2021-01-06 08:31

    Yes, it's called browser invocation.

    This article explains how to do it. The main point is that you need to set the allowBrowserInvocation value to true in the AIR application's descriptor xml and listen for invocation events.

    This post gives a more concrete example, though it is a tad old.

    0 讨论(0)
提交回复
热议问题