开发者

How to test AIR NativeWindow.invoke within the IDE?

开发者 https://www.devze.com 2023-03-18 17:50 出处:网络
I am trying to debug an invoke handler. The Flash Builder IDE seems to stop the running AIR application when I start it the second time, so I never get to debug the second invoke (i.e. while the appli

I am trying to debug an invoke handler. The Flash Builder IDE seems to stop the running AIR application when I start it the second time, so I never get to debug the second invoke (i.e. while the application is already running).

Any ideas?

(P.S. any clever way to tell the difference between the first and subsequent invoke events other than a global counter?)

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"
                   invoke="onInvoke(event)">
    <fx:Script>
        <![CDATA[
            private function onInvoke(event : InvokeEvent) : void
            {
                logText.text +=
                    "invoke: event.arguments = " + event.arguments.toString() +      
                    "; event.currentDirectory = " + ((event.currentDirectory != null) ? event.currentDirectory.nativePath : "null") +
                    "; event.reason 开发者_如何学JAVA= " + ((event.reason != null) ? event.reason : "null") + "\n";
            }
        ]]>
    </fx:Script>

    <s:TextArea id="logText" left="10" right="10" top="105" bottom="10"/>
</s:WindowedApplication>


The answer seems to be that one cannot test subsequent invocations inside the IDE.

That's okay: you can put a big, ugly testing button that calls whatever the invokeHandler() would have called when it detected that it was not the first occurrence.

0

精彩评论

暂无评论...
验证码 换一张
取 消