Adobe air command line options

I use command line options that go into the call handler of my WindowedApplication. I used to create using excellent Flash development, now we use Flash Builder 4.

I would like to know where I can enter these options in Flash Builder 4 so that I can test them when debugging my application.

+3
source share
2 answers
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);   

function onInvoke(e:InvokeEvent):void   
{  
    trace('onInvoke', e.arguments);  
}  
+4
source

Answering this question for the Spark Application container. The WindowedApplication class allows you to:

<s:WindowedApplication
    invoke="onInvoke()"
>

but the application container is not working, so instead you need to do this:

<s:Application
    ...
    preinitialize="onPreinitialize()"
>

<fx:Script>
    <![CDATA[
        private function onPreinitialize():void
        {
            NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
        }

        private function onInvoke(e:InvokeEvent):void
        {
             // e.arguments is an array containing the command line args
        }
    ]]>
</fx:Script>
+2
source

Source: https://habr.com/ru/post/1778932/


All Articles